@spinnaker/amazon 0.8.14 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +62 -0
- package/dist/aws.settings.d.ts +1 -1
- package/dist/certificates/AmazonCertificateReader.d.ts +1 -1
- package/dist/deploymentStrategy/AdditionalFields.d.ts +2 -2
- package/dist/deploymentStrategy/rollingPush.strategy.d.ts +1 -1
- package/dist/domain/IAmazonCertificate.d.ts +1 -1
- package/dist/domain/IAmazonFunction.d.ts +1 -1
- package/dist/domain/IAmazonFunctionSourceData.d.ts +2 -1
- package/dist/domain/IAmazonHealth.d.ts +1 -1
- package/dist/domain/IAmazonInstance.d.ts +2 -2
- package/dist/domain/IAmazonLaunchTemplate.d.ts +1 -1
- package/dist/domain/IAmazonLoadBalancer.d.ts +4 -4
- package/dist/domain/IAmazonLoadBalancerSourceData.d.ts +3 -3
- package/dist/domain/IAmazonScalingPolicy.d.ts +3 -1
- package/dist/domain/IAmazonServerGroup.d.ts +5 -5
- package/dist/domain/IScalingPolicy.d.ts +1 -1
- package/dist/domain/ITargetTrackingPolicy.d.ts +1 -1
- package/dist/function/CreateLambdaFunction.d.ts +3 -2
- package/dist/function/configure/ExecutionRole.d.ts +4 -4
- package/dist/function/configure/FunctionBasicInformation.d.ts +4 -4
- package/dist/function/configure/FunctionDebugAndErrorHandling.d.ts +4 -4
- package/dist/function/configure/FunctionEnvironmentVariables.d.ts +4 -4
- package/dist/function/configure/FunctionSettings.d.ts +4 -4
- package/dist/function/configure/FunctionTags.d.ts +4 -4
- package/dist/function/configure/Network.d.ts +3 -3
- package/dist/function/details/AmazonFunctionDetails.d.ts +1 -1
- package/dist/function/details/FunctionActions.d.ts +3 -3
- package/dist/function/function.transformer.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/instance/amazon.instance.write.service.d.ts +3 -2
- package/dist/instance/details/AmazonInstanceInformation.d.ts +2 -1
- package/dist/instance/details/InstanceDns.d.ts +1 -0
- package/dist/instance/details/InstanceInformation.d.ts +1 -0
- package/dist/instance/details/InstanceSecurityGroups.d.ts +2 -1
- package/dist/instance/details/InstanceStatus.d.ts +2 -1
- package/dist/instance/details/InstanceTags.d.ts +1 -0
- package/dist/instance/details/utils.d.ts +1 -1
- package/dist/keyPairs/KeyPairsReader.d.ts +1 -1
- package/dist/loadBalancer/AmazonLoadBalancerClusterContainer.d.ts +1 -1
- package/dist/loadBalancer/AmazonLoadBalancersTag.d.ts +2 -2
- package/dist/loadBalancer/TargetGroup.d.ts +1 -1
- package/dist/loadBalancer/TargetGroupDetails.d.ts +1 -1
- package/dist/loadBalancer/amazonLoadBalancerDataUtils.d.ts +2 -2
- package/dist/loadBalancer/configure/AmazonLoadBalancerChoiceModal.d.ts +2 -2
- package/dist/loadBalancer/configure/LoadBalancerTypes.d.ts +2 -2
- package/dist/loadBalancer/configure/application/ALBListeners.d.ts +4 -4
- package/dist/loadBalancer/configure/application/ConfigureOidcConfigModal.d.ts +1 -1
- package/dist/loadBalancer/configure/application/ConfigureRedirectConfigModal.d.ts +1 -1
- package/dist/loadBalancer/configure/application/CreateApplicationLoadBalancer.d.ts +3 -2
- package/dist/loadBalancer/configure/application/TargetGroups.d.ts +3 -3
- package/dist/loadBalancer/configure/classic/AdvancedSettings.d.ts +2 -2
- package/dist/loadBalancer/configure/classic/CreateClassicLoadBalancer.d.ts +3 -2
- package/dist/loadBalancer/configure/classic/HealthCheck.d.ts +2 -2
- package/dist/loadBalancer/configure/classic/Listeners.d.ts +3 -3
- package/dist/loadBalancer/configure/common/AmazonCertificateSelectField.d.ts +2 -2
- package/dist/loadBalancer/configure/common/LoadBalancerLocation.d.ts +3 -3
- package/dist/loadBalancer/configure/common/SecurityGroups.d.ts +3 -3
- package/dist/loadBalancer/configure/common/targetGroupValidators.d.ts +2 -2
- package/dist/loadBalancer/configure/network/CertificateSelectors.d.ts +2 -1
- package/dist/loadBalancer/configure/network/CreateNetworkLoadBalancer.d.ts +3 -2
- package/dist/loadBalancer/configure/network/NLBListeners.d.ts +4 -4
- package/dist/loadBalancer/configure/network/TargetGroups.d.ts +3 -3
- package/dist/loadBalancer/details/LoadBalancerActions.d.ts +3 -3
- package/dist/loadBalancer/details/loadBalancerDetails.controller.d.ts +4 -4
- package/dist/loadBalancer/details/targetGroupDetails.controller.d.ts +4 -4
- package/dist/loadBalancer/loadBalancer.transformer.d.ts +2 -2
- package/dist/pipeline/stages/deployCloudFormation/CloudFormationChangeSetInfo.d.ts +2 -1
- package/dist/pipeline/stages/deployCloudFormation/deployCloudFormationExecutionDetails.d.ts +1 -1
- package/dist/pipeline/stages/deployCloudFormation/deployCloudFormationStackConfig.controller.d.ts +3 -2
- package/dist/pipeline/stages/deployCloudFormation/evaluateCloudFormationChangeSetExecution.service.d.ts +3 -3
- package/dist/pipeline/stages/deployCloudFormation/evaluateCloudFormationChangeSetExecutionApproval.d.ts +2 -1
- package/dist/pipeline/stages/deployCloudFormation/evaluateCloudFormationChangeSetExecutionDetails.d.ts +1 -1
- package/dist/pipeline/stages/deployCloudFormation/evaluateCloudFormationChangeSetExecutionLabel.d.ts +2 -2
- package/dist/pipeline/stages/deployCloudFormation/evaluateCloudFormationChangeSetExecutionMarkerIcon.d.ts +1 -1
- package/dist/reactShims/aws.ngReact.d.ts +2 -2
- package/dist/reactShims/aws.react.injector.d.ts +5 -4
- package/dist/reactShims/index.d.ts +0 -1
- package/dist/securityGroup/configure/securityGroupDetailsCustom.d.ts +1 -1
- package/dist/securityGroup/securityGroup.reader.d.ts +1 -1
- package/dist/serverGroup/configure/AmazonImageSelectInput.d.ts +2 -2
- package/dist/serverGroup/configure/serverGroupConfiguration.service.d.ts +2 -2
- package/dist/serverGroup/configure/wizard/AmazonCloneServerGroupModal.d.ts +3 -2
- package/dist/serverGroup/configure/wizard/ServerGroupTemplateSelection.d.ts +1 -1
- package/dist/serverGroup/configure/wizard/capacity/CapacitySelector.d.ts +2 -2
- package/dist/serverGroup/configure/wizard/capacity/MinMaxDesired.d.ts +1 -1
- package/dist/serverGroup/configure/wizard/instanceType/CpuCreditsToggle.d.ts +2 -1
- package/dist/serverGroup/configure/wizard/pages/ServerGroupBasicSettings.d.ts +4 -4
- package/dist/serverGroup/configure/wizard/pages/ServerGroupCapacity.d.ts +3 -3
- package/dist/serverGroup/configure/wizard/pages/ServerGroupInstanceType.d.ts +3 -3
- package/dist/serverGroup/configure/wizard/pages/ServerGroupLoadBalancers.d.ts +3 -3
- package/dist/serverGroup/configure/wizard/pages/ServerGroupSecurityGroups.d.ts +3 -3
- package/dist/serverGroup/configure/wizard/pages/ServerGroupZones.d.ts +3 -3
- package/dist/serverGroup/configure/wizard/pages/advancedSettings/ServerGroupAdvancedSettings.d.ts +3 -3
- package/dist/serverGroup/configure/wizard/pages/advancedSettings/ServerGroupAdvancedSettingsCommon.d.ts +2 -2
- package/dist/serverGroup/configure/wizard/pages/advancedSettings/ServerGroupAdvancedSettingsInner.d.ts +4 -4
- package/dist/serverGroup/configure/wizard/securityGroups/SecurityGroupSelector.d.ts +2 -2
- package/dist/serverGroup/configure/wizard/securityGroups/ServerGroupSecurityGroupsRemoved.d.ts +1 -1
- package/dist/serverGroup/details/AmazonServerGroupActions.d.ts +3 -3
- package/dist/serverGroup/details/amazonServerGroupDetailsGetter.d.ts +2 -2
- package/dist/serverGroup/details/resize/AmazonResizeServerGroupModal.d.ts +3 -2
- package/dist/serverGroup/details/scalingPolicy/CreateScalingPolicyButton.d.ts +2 -2
- package/dist/serverGroup/details/scalingPolicy/ScalingPolicySummary.d.ts +7 -4
- package/dist/serverGroup/details/scalingPolicy/ScalingPolicyWriter.d.ts +2 -2
- package/dist/serverGroup/details/scalingPolicy/StepPolicySummary.d.ts +10 -0
- package/dist/serverGroup/details/scalingPolicy/chart/DateLineChart.d.ts +2 -1
- package/dist/serverGroup/details/scalingPolicy/chart/MetricAlarmChart.d.ts +4 -3
- package/dist/serverGroup/details/scalingPolicy/detailsSummary.component.d.ts +3 -3
- package/dist/serverGroup/details/scalingPolicy/index.d.ts +4 -0
- package/dist/serverGroup/details/scalingPolicy/popover/AlarmSummary.d.ts +8 -1
- package/dist/serverGroup/details/scalingPolicy/popover/StepPolicyPopoverContent.d.ts +7 -0
- package/dist/serverGroup/details/scalingPolicy/scalingPolicySummary.component.d.ts +1 -0
- package/dist/serverGroup/details/scalingPolicy/stepPolicySummary.component.d.ts +1 -0
- package/dist/serverGroup/details/scalingPolicy/targetTracking/TargetMetricFields.d.ts +4 -4
- package/dist/serverGroup/details/scalingPolicy/targetTracking/TargetTrackingAdditionalSettings.d.ts +2 -1
- package/dist/serverGroup/details/scalingPolicy/targetTracking/TargetTrackingChart.d.ts +2 -1
- package/dist/serverGroup/details/scalingPolicy/targetTracking/TargetTrackingSummary.d.ts +10 -0
- package/dist/serverGroup/details/scalingPolicy/targetTracking/UpsertTargetTrackingModal.d.ts +3 -2
- package/dist/serverGroup/details/scalingPolicy/upsert/PolicyTypeSelectionModal.d.ts +1 -0
- package/dist/serverGroup/details/scalingPolicy/upsert/ScalingPolicyAdditionalSettings.d.ts +2 -1
- package/dist/serverGroup/details/scalingPolicy/upsert/ScalingPolicyCommandBuilderService.d.ts +2 -2
- package/dist/serverGroup/details/scalingPolicy/upsert/UpsertScalingPolicyModal.d.ts +3 -2
- package/dist/serverGroup/details/scalingPolicy/upsert/alarm/AlarmConfigurer.d.ts +6 -1
- package/dist/serverGroup/details/scalingPolicy/upsert/alarm/DimensionsEditor.d.ts +4 -3
- package/dist/serverGroup/details/scalingPolicy/upsert/alarm/MetricSelector.d.ts +3 -2
- package/dist/serverGroup/details/scalingPolicy/upsert/index.d.ts +1 -0
- package/dist/serverGroup/details/scalingPolicy/upsert/simple/SimplePolicyAction.d.ts +1 -0
- package/dist/serverGroup/details/scalingPolicy/upsert/step/StepPolicyAction.d.ts +2 -1
- package/dist/serverGroup/details/scalingProcesses/AutoScalingProcessService.d.ts +1 -1
- package/dist/serverGroup/details/scheduledAction/ScheduledAction.d.ts +1 -1
- package/dist/serverGroup/details/sections/AdvancedSettingsDetailsSection.d.ts +1 -1
- package/dist/serverGroup/details/sections/AmazonCapacityDetailsSection.d.ts +1 -1
- package/dist/serverGroup/details/sections/AmazonInfoDetailsSection.d.ts +2 -2
- package/dist/serverGroup/details/sections/HealthDetailsSection.d.ts +1 -1
- package/dist/serverGroup/details/sections/IAmazonServerGroupDetailsSectionProps.d.ts +2 -2
- package/dist/serverGroup/details/sections/InstancesDistributionDetailsSection.d.ts +2 -1
- package/dist/serverGroup/details/sections/LaunchConfigDetailsSection.d.ts +1 -1
- package/dist/serverGroup/details/sections/LaunchTemplateDetailsSection.d.ts +2 -1
- package/dist/serverGroup/details/sections/LogsDetailsSection.d.ts +1 -1
- package/dist/serverGroup/details/sections/MultipleInstanceTypesSubSection.d.ts +2 -1
- package/dist/serverGroup/details/sections/PackageDetailsSection.d.ts +1 -1
- package/dist/serverGroup/details/sections/ScalingPoliciesDetailsSection.d.ts +2 -2
- package/dist/serverGroup/details/sections/ScalingProcessesDetailsSection.d.ts +2 -2
- package/dist/serverGroup/details/sections/ScheduledActionsDetailsSection.d.ts +1 -1
- package/dist/serverGroup/details/sections/SecurityGroupsDetailsSection.d.ts +2 -2
- package/dist/serverGroup/details/sections/TagsDetailsSection.d.ts +1 -1
- package/dist/serverGroup/serverGroup.transformer.d.ts +1 -1
- package/dist/subnet/SubnetSelectField.d.ts +1 -1
- package/dist/subnet/SubnetSelectInput.d.ts +2 -2
- package/dist/subnet/subnet.renderer.d.ts +1 -1
- package/dist/vpc/VpcReader.d.ts +1 -1
- package/dist/vpc/VpcTag.d.ts +1 -0
- package/package.json +6 -6
- package/src/aws.module.ts +11 -1
- package/src/aws.settings.ts +2 -1
- package/src/certificates/AmazonCertificateReader.ts +1 -1
- package/src/common/AwsModalFooter.tsx +2 -1
- package/src/common/footer.component.ts +2 -1
- package/src/deploymentStrategy/AdditionalFields.tsx +3 -2
- package/src/deploymentStrategy/rollingPush.strategy.ts +2 -1
- package/src/domain/IAmazonCertificate.ts +1 -1
- package/src/domain/IAmazonFunction.ts +1 -1
- package/src/domain/IAmazonFunctionSourceData.ts +2 -1
- package/src/domain/IAmazonHealth.ts +1 -1
- package/src/domain/IAmazonInstance.ts +2 -2
- package/src/domain/IAmazonLaunchTemplate.ts +1 -1
- package/src/domain/IAmazonLoadBalancer.ts +4 -4
- package/src/domain/IAmazonLoadBalancerSourceData.ts +3 -3
- package/src/domain/IAmazonScalingPolicy.ts +3 -1
- package/src/domain/IAmazonServerGroup.ts +5 -5
- package/src/domain/IScalingPolicy.ts +1 -1
- package/src/domain/ITargetTrackingPolicy.ts +1 -1
- package/src/function/CreateLambdaFunction.tsx +3 -11
- package/src/function/configure/ExecutionRole.tsx +5 -4
- package/src/function/configure/FunctionBasicInformation.tsx +6 -8
- package/src/function/configure/FunctionDebugAndErrorHandling.tsx +5 -11
- package/src/function/configure/FunctionEnvironmentVariables.tsx +5 -11
- package/src/function/configure/FunctionSettings.tsx +5 -4
- package/src/function/configure/FunctionTags.tsx +5 -4
- package/src/function/configure/Network.tsx +8 -6
- package/src/function/details/AmazonFunctionDetails.tsx +30 -10
- package/src/function/details/FunctionActions.spec.tsx +24 -1
- package/src/function/details/FunctionActions.tsx +30 -28
- package/src/function/function.transformer.ts +2 -2
- package/src/instance/amazon.instance.write.service.ts +3 -9
- package/src/instance/details/AmazonInstanceInformation.tsx +1 -1
- package/src/instance/details/InstanceSecurityGroups.tsx +1 -1
- package/src/instance/details/InstanceStatus.tsx +1 -1
- package/src/instance/details/instance.details.controller.js +2 -0
- package/src/instance/details/instanceDetails.html +1 -1
- package/src/instance/details/utils.ts +6 -1
- package/src/keyPairs/KeyPairsReader.ts +1 -1
- package/src/loadBalancer/AmazonLoadBalancerClusterContainer.tsx +3 -2
- package/src/loadBalancer/AmazonLoadBalancersTag.tsx +2 -3
- package/src/loadBalancer/TargetGroup.tsx +1 -1
- package/src/loadBalancer/TargetGroupDetails.tsx +2 -1
- package/src/loadBalancer/amazonLoadBalancerDataUtils.ts +3 -2
- package/src/loadBalancer/configure/AmazonLoadBalancerChoiceModal.tsx +4 -10
- package/src/loadBalancer/configure/LoadBalancerTypes.ts +2 -2
- package/src/loadBalancer/configure/application/ALBListeners.tsx +9 -14
- package/src/loadBalancer/configure/application/ConfigureOidcConfigModal.tsx +3 -2
- package/src/loadBalancer/configure/application/ConfigureRedirectConfigModal.tsx +1 -1
- package/src/loadBalancer/configure/application/CreateApplicationLoadBalancer.tsx +2 -2
- package/src/loadBalancer/configure/application/TargetGroups.tsx +3 -4
- package/src/loadBalancer/configure/classic/AdvancedSettings.tsx +2 -2
- package/src/loadBalancer/configure/classic/CreateClassicLoadBalancer.tsx +3 -3
- package/src/loadBalancer/configure/classic/HealthCheck.tsx +2 -2
- package/src/loadBalancer/configure/classic/Listeners.tsx +3 -3
- package/src/loadBalancer/configure/common/AmazonCertificateSelectField.tsx +5 -3
- package/src/loadBalancer/configure/common/LoadBalancerLocation.tsx +6 -9
- package/src/loadBalancer/configure/common/SecurityGroups.tsx +4 -11
- package/src/loadBalancer/configure/common/targetGroupValidators.ts +2 -2
- package/src/loadBalancer/configure/network/CertificateSelectors.tsx +3 -2
- package/src/loadBalancer/configure/network/CreateNetworkLoadBalancer.tsx +3 -3
- package/src/loadBalancer/configure/network/NLBListeners.tsx +5 -4
- package/src/loadBalancer/configure/network/TargetGroups.tsx +3 -4
- package/src/loadBalancer/details/LoadBalancerActions.tsx +48 -46
- package/src/loadBalancer/details/loadBalancerDetails.controller.ts +10 -7
- package/src/loadBalancer/details/targetGroupDetails.controller.ts +6 -4
- package/src/loadBalancer/loadBalancer.transformer.ts +3 -11
- package/src/loadBalancer/targetGroup.states.ts +3 -2
- package/src/pipeline/stages/deployCloudFormation/CloudFormationChangeSetInfo.tsx +2 -9
- package/src/pipeline/stages/deployCloudFormation/cloudFormationTemplateEntry.component.ts +2 -1
- package/src/pipeline/stages/deployCloudFormation/deployCloudFormationExecutionDetails.tsx +2 -6
- package/src/pipeline/stages/deployCloudFormation/deployCloudFormationStackConfig.controller.ts +3 -9
- package/src/pipeline/stages/deployCloudFormation/deployCloudFormationStackStage.ts +2 -1
- package/src/pipeline/stages/deployCloudFormation/evaluateCloudFormationChangeSetExecution.service.ts +4 -3
- package/src/pipeline/stages/deployCloudFormation/evaluateCloudFormationChangeSetExecutionApproval.tsx +2 -1
- package/src/pipeline/stages/deployCloudFormation/evaluateCloudFormationChangeSetExecutionDetails.tsx +1 -1
- package/src/pipeline/stages/deployCloudFormation/evaluateCloudFormationChangeSetExecutionLabel.tsx +2 -2
- package/src/pipeline/stages/deployCloudFormation/evaluateCloudFormationChangeSetExecutionMarkerIcon.tsx +1 -1
- package/src/reactShims/aws.ngReact.ts +2 -2
- package/src/reactShims/aws.react.injector.ts +5 -4
- package/src/reactShims/aws.react.module.ts +0 -2
- package/src/reactShims/index.ts +0 -1
- package/src/securityGroup/configure/ingressRuleGroupSelector.component.ts +4 -3
- package/src/securityGroup/configure/securityGroupDetailsCustom.tsx +1 -1
- package/src/securityGroup/details/securityGroupDetail.controller.js +3 -0
- package/src/securityGroup/details/securityGroupDetail.html +1 -1
- package/src/securityGroup/securityGroup.reader.ts +1 -1
- package/src/serverGroup/configure/AmazonImageSelectInput.tsx +5 -3
- package/src/serverGroup/configure/serverGroupCommandBuilder.service.js +1 -1
- package/src/serverGroup/configure/serverGroupConfiguration.service.ts +9 -7
- package/src/serverGroup/configure/wizard/AmazonCloneServerGroupModal.tsx +3 -13
- package/src/serverGroup/configure/wizard/ServerGroupTemplateSelection.tsx +2 -7
- package/src/serverGroup/configure/wizard/capacity/CapacitySelector.tsx +5 -3
- package/src/serverGroup/configure/wizard/capacity/MinMaxDesired.tsx +2 -1
- package/src/serverGroup/configure/wizard/instanceType/CpuCreditsToggle.tsx +1 -1
- package/src/serverGroup/configure/wizard/pages/ServerGroupBasicSettings.tsx +5 -6
- package/src/serverGroup/configure/wizard/pages/ServerGroupCapacity.tsx +4 -3
- package/src/serverGroup/configure/wizard/pages/ServerGroupInstanceType.tsx +4 -3
- package/src/serverGroup/configure/wizard/pages/ServerGroupLoadBalancers.tsx +5 -4
- package/src/serverGroup/configure/wizard/pages/ServerGroupSecurityGroups.tsx +3 -3
- package/src/serverGroup/configure/wizard/pages/ServerGroupZones.tsx +3 -3
- package/src/serverGroup/configure/wizard/pages/advancedSettings/ServerGroupAdvancedSettings.tsx +3 -3
- package/src/serverGroup/configure/wizard/pages/advancedSettings/ServerGroupAdvancedSettingsCommon.tsx +4 -3
- package/src/serverGroup/configure/wizard/pages/advancedSettings/ServerGroupAdvancedSettingsInner.tsx +5 -4
- package/src/serverGroup/configure/wizard/securityGroups/SecurityGroupSelector.tsx +4 -10
- package/src/serverGroup/configure/wizard/securityGroups/ServerGroupSecurityGroupsRemoved.tsx +1 -1
- package/src/serverGroup/details/AmazonServerGroupActions.tsx +56 -56
- package/src/serverGroup/details/amazonServerGroupDetailsGetter.ts +3 -2
- package/src/serverGroup/details/resize/AmazonResizeServerGroupModal.tsx +4 -6
- package/src/serverGroup/details/scalingPolicy/CreateScalingPolicyButton.tsx +7 -4
- package/src/serverGroup/details/scalingPolicy/ScalingPolicySummary.tsx +25 -4
- package/src/serverGroup/details/scalingPolicy/ScalingPolicyWriter.ts +3 -2
- package/src/serverGroup/details/scalingPolicy/StepPolicySummary.less +10 -0
- package/src/serverGroup/details/scalingPolicy/StepPolicySummary.tsx +122 -0
- package/src/serverGroup/details/scalingPolicy/alarmBasedSummary.template.html +2 -2
- package/src/serverGroup/details/scalingPolicy/chart/DateLineChart.tsx +7 -5
- package/src/serverGroup/details/scalingPolicy/chart/MetricAlarmChart.tsx +6 -11
- package/src/serverGroup/details/scalingPolicy/detailsSummary.component.ts +4 -3
- package/src/serverGroup/details/scalingPolicy/index.ts +4 -0
- package/src/serverGroup/details/scalingPolicy/popover/AlarmSummary.tsx +16 -7
- package/src/serverGroup/details/scalingPolicy/popover/StepPolicyPopoverContent.tsx +90 -0
- package/src/serverGroup/details/scalingPolicy/popover/scalingPolicyPopover.component.ts +2 -1
- package/src/serverGroup/details/scalingPolicy/scalingPolicy.module.ts +4 -2
- package/src/serverGroup/details/scalingPolicy/scalingPolicySummary.component.ts +10 -0
- package/src/serverGroup/details/scalingPolicy/stepPolicySummary.component.ts +10 -0
- package/src/serverGroup/details/scalingPolicy/targetTracking/TargetMetricFields.tsx +19 -26
- package/src/serverGroup/details/scalingPolicy/targetTracking/TargetTrackingAdditionalSettings.tsx +1 -1
- package/src/serverGroup/details/scalingPolicy/targetTracking/TargetTrackingChart.tsx +3 -3
- package/src/serverGroup/details/scalingPolicy/targetTracking/TargetTrackingSummary.less +11 -0
- package/src/serverGroup/details/scalingPolicy/targetTracking/TargetTrackingSummary.tsx +117 -0
- package/src/serverGroup/details/scalingPolicy/targetTracking/UpsertTargetTrackingModal.tsx +4 -3
- package/src/serverGroup/details/scalingPolicy/targetTracking/targetTrackingSummary.component.ts +12 -83
- package/src/serverGroup/details/scalingPolicy/upsert/ScalingPolicyAdditionalSettings.tsx +10 -12
- package/src/serverGroup/details/scalingPolicy/upsert/ScalingPolicyCommandBuilderService.ts +2 -2
- package/src/serverGroup/details/scalingPolicy/upsert/UpsertScalingPolicyModal.tsx +6 -4
- package/src/serverGroup/details/scalingPolicy/upsert/alarm/AlarmConfigurer.tsx +16 -18
- package/src/serverGroup/details/scalingPolicy/upsert/alarm/DimensionsEditor.tsx +14 -20
- package/src/serverGroup/details/scalingPolicy/upsert/alarm/MetricSelector.tsx +26 -50
- package/src/serverGroup/details/scalingPolicy/upsert/index.ts +1 -0
- package/src/serverGroup/details/scalingPolicy/upsert/simple/SimplePolicyAction.tsx +3 -5
- package/src/serverGroup/details/scalingPolicy/upsert/step/StepPolicyAction.tsx +8 -18
- package/src/serverGroup/details/scalingProcesses/AutoScalingProcessService.ts +1 -1
- package/src/serverGroup/details/scheduledAction/ScheduledAction.tsx +1 -1
- package/src/serverGroup/details/sections/AdvancedSettingsDetailsSection.tsx +7 -5
- package/src/serverGroup/details/sections/AmazonCapacityDetailsSection.tsx +8 -5
- package/src/serverGroup/details/sections/AmazonInfoDetailsSection.tsx +4 -12
- package/src/serverGroup/details/sections/HealthDetailsSection.tsx +1 -1
- package/src/serverGroup/details/sections/IAmazonServerGroupDetailsSectionProps.ts +2 -2
- package/src/serverGroup/details/sections/InstancesDistributionDetailsSection.tsx +1 -1
- package/src/serverGroup/details/sections/LaunchConfigDetailsSection.tsx +2 -2
- package/src/serverGroup/details/sections/LaunchTemplateDetailsSection.tsx +1 -1
- package/src/serverGroup/details/sections/LogsDetailsSection.tsx +1 -1
- package/src/serverGroup/details/sections/MultipleInstanceTypesSubSection.tsx +1 -1
- package/src/serverGroup/details/sections/PackageDetailsSection.tsx +1 -1
- package/src/serverGroup/details/sections/ScalingPoliciesDetailsSection.tsx +10 -7
- package/src/serverGroup/details/sections/ScalingProcessesDetailsSection.tsx +16 -6
- package/src/serverGroup/details/sections/ScheduledActionsDetailsSection.tsx +8 -6
- package/src/serverGroup/details/sections/SecurityGroupsDetailsSection.tsx +4 -10
- package/src/serverGroup/details/sections/TagsDetailsSection.tsx +1 -1
- package/src/serverGroup/serverGroup.transformer.ts +2 -2
- package/src/subnet/SubnetSelectField.tsx +2 -1
- package/src/subnet/SubnetSelectInput.tsx +4 -12
- package/src/subnet/subnet.renderer.ts +1 -1
- package/src/validation/ApplicationNameValidator.ts +2 -1
- package/src/vpc/VpcReader.ts +2 -1
- package/src/serverGroup/details/scalingPolicy/targetTracking/targetTrackingPopover.html +0 -5
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
|
|
4
4
|
import { HelpField, NumberInput } from '@spinnaker/core';
|
|
5
5
|
|
|
6
|
-
import { IUpsertScalingPolicyCommand } from '../ScalingPolicyWriter';
|
|
6
|
+
import type { IUpsertScalingPolicyCommand } from '../ScalingPolicyWriter';
|
|
7
7
|
import './ScalingPolicyAdditionalSettings.less';
|
|
8
8
|
|
|
9
9
|
export interface IScalingPolicyAdditionalSettingsProps {
|
|
@@ -21,11 +21,9 @@ export const ScalingPolicyAdditionalSettings = ({
|
|
|
21
21
|
operator,
|
|
22
22
|
updateCommand,
|
|
23
23
|
}: IScalingPolicyAdditionalSettingsProps) => {
|
|
24
|
-
const [commandView, setCommandView] = React.useState<IUpsertScalingPolicyCommand>(command);
|
|
25
24
|
const setCommandField = (path: string, value: number) => {
|
|
26
25
|
const newCommand = { ...command };
|
|
27
26
|
set(newCommand, path, value);
|
|
28
|
-
setCommandView(newCommand);
|
|
29
27
|
updateCommand(newCommand);
|
|
30
28
|
};
|
|
31
29
|
|
|
@@ -37,7 +35,7 @@ export const ScalingPolicyAdditionalSettings = ({
|
|
|
37
35
|
<div className="row">
|
|
38
36
|
<div className="col-md-2 sm-label-right">Policy Name</div>
|
|
39
37
|
<div className="col-md-10 horizontal middle">
|
|
40
|
-
<span className="form-control-static select-placeholder">{
|
|
38
|
+
<span className="form-control-static select-placeholder">{command.name}</span>
|
|
41
39
|
</div>
|
|
42
40
|
</div>
|
|
43
41
|
)}
|
|
@@ -49,7 +47,7 @@ export const ScalingPolicyAdditionalSettings = ({
|
|
|
49
47
|
{`${operator} instances in increments of at least `}
|
|
50
48
|
</span>
|
|
51
49
|
<NumberInput
|
|
52
|
-
value={
|
|
50
|
+
value={command.minAdjustmentMagnitude}
|
|
53
51
|
onChange={(e) => setCommandField('minAdjustmentMagnitude', Number.parseInt(e.target.value))}
|
|
54
52
|
inputClassName="sp-margin-xs-xaxis input-sm number-input-sm"
|
|
55
53
|
/>
|
|
@@ -57,13 +55,13 @@ export const ScalingPolicyAdditionalSettings = ({
|
|
|
57
55
|
</div>
|
|
58
56
|
</div>
|
|
59
57
|
)}
|
|
60
|
-
{Boolean(
|
|
58
|
+
{Boolean(command.simple) && (
|
|
61
59
|
<div className="row">
|
|
62
60
|
<div className="col-md-2 sm-label-right">Cooldown</div>
|
|
63
61
|
<div className="col-md-10 horizontal middle">
|
|
64
62
|
<span className="form-control-static select-placeholder"> Wait at least </span>
|
|
65
63
|
<NumberInput
|
|
66
|
-
value={
|
|
64
|
+
value={command.simple?.cooldown}
|
|
67
65
|
onChange={(e) => setCommandField('simple.cooldown', Number.parseInt(e.target.value))}
|
|
68
66
|
inputClassName="sp-margin-xs-xaxis input-sm number-input-sm"
|
|
69
67
|
/>
|
|
@@ -71,13 +69,13 @@ export const ScalingPolicyAdditionalSettings = ({
|
|
|
71
69
|
</div>
|
|
72
70
|
</div>
|
|
73
71
|
)}
|
|
74
|
-
{Boolean(
|
|
72
|
+
{Boolean(command.step?.estimatedInstanceWarmup) && operator !== 'Remove' && (
|
|
75
73
|
<div className="row">
|
|
76
74
|
<div className="col-md-2 sm-label-right">Warmup</div>
|
|
77
75
|
<div className="col-md-10 horizontal middle">
|
|
78
76
|
<span className="form-control-static select-placeholder">Instances need</span>
|
|
79
77
|
<NumberInput
|
|
80
|
-
value={
|
|
78
|
+
value={command.step.estimatedInstanceWarmup}
|
|
81
79
|
onChange={(e) => setCommandField('step.estimatedInstanceWarmup', Number.parseInt(e.target.value))}
|
|
82
80
|
inputClassName="sp-margin-xs-xaxis input-sm number-input-sm"
|
|
83
81
|
/>
|
|
@@ -85,15 +83,15 @@ export const ScalingPolicyAdditionalSettings = ({
|
|
|
85
83
|
</div>
|
|
86
84
|
</div>
|
|
87
85
|
)}
|
|
88
|
-
{Boolean(
|
|
86
|
+
{Boolean(command.step?.cooldown) && operator !== 'Remove' && (
|
|
89
87
|
<div className="row">
|
|
90
88
|
<div className="col-md-2 sm-label-right">
|
|
91
89
|
<span className="sp-margin-xs-right">Cooldown</span>
|
|
92
|
-
<HelpField id={`${
|
|
90
|
+
<HelpField id={`${command.cloudProvider || command.provider}.autoscaling.cooldown`} />
|
|
93
91
|
</div>
|
|
94
92
|
<div className="col-md-10 horizontal middle">
|
|
95
93
|
<NumberInput
|
|
96
|
-
value={
|
|
94
|
+
value={command.step?.cooldown}
|
|
97
95
|
onChange={(e) => setCommandField('step.cooldown', Number.parseInt(e.target.value))}
|
|
98
96
|
inputClassName="sp-margin-xs-xaxis input-sm number-input-sm"
|
|
99
97
|
/>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { cloneDeep } from 'lodash';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import type {
|
|
4
4
|
ISimplePolicyDescription,
|
|
5
5
|
IStepPolicyDescription,
|
|
6
6
|
IUpsertAlarmDescription,
|
|
7
7
|
IUpsertScalingPolicyCommand,
|
|
8
8
|
} from '../ScalingPolicyWriter';
|
|
9
|
-
import {
|
|
9
|
+
import type {
|
|
10
10
|
IAmazonServerGroup,
|
|
11
11
|
IScalingPolicy,
|
|
12
12
|
IScalingPolicyAlarm,
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { cloneDeep } from 'lodash';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
import { Application, IModalComponentProps
|
|
4
|
+
import type { Application, IModalComponentProps } from '@spinnaker/core';
|
|
5
|
+
import { TaskMonitorModal } from '@spinnaker/core';
|
|
5
6
|
|
|
6
7
|
import { ScalingPolicyAdditionalSettings } from './ScalingPolicyAdditionalSettings';
|
|
7
8
|
import { ScalingPolicyCommandBuilder } from './ScalingPolicyCommandBuilderService';
|
|
8
|
-
import { IStepPolicyDescription, IUpsertScalingPolicyCommand } from '../ScalingPolicyWriter';
|
|
9
|
+
import type { IStepPolicyDescription, IUpsertScalingPolicyCommand } from '../ScalingPolicyWriter';
|
|
9
10
|
import { AlarmConfigurer } from './alarm/AlarmConfigurer';
|
|
10
|
-
import { IAmazonServerGroup, IScalingPolicy, IStepAdjustment, ITargetTrackingPolicy } from '../../../../domain';
|
|
11
|
+
import type { IAmazonServerGroup, IScalingPolicy, IStepAdjustment, ITargetTrackingPolicy } from '../../../../domain';
|
|
11
12
|
import { SimplePolicyAction } from './simple/SimplePolicyAction';
|
|
12
|
-
import { AdjustmentTypeView, Operator
|
|
13
|
+
import type { AdjustmentTypeView, Operator } from './step/StepPolicyAction';
|
|
14
|
+
import { StepPolicyAction } from './step/StepPolicyAction';
|
|
13
15
|
|
|
14
16
|
export interface IUpsertScalingPolicyModalProps extends IModalComponentProps {
|
|
15
17
|
app: Application;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
import { ICloudMetricStatistics
|
|
3
|
+
import type { ICloudMetricStatistics } from '@spinnaker/core';
|
|
4
|
+
import { NumberInput, ReactSelectInput, usePrevious } from '@spinnaker/core';
|
|
4
5
|
|
|
5
6
|
import { MetricSelector } from './MetricSelector';
|
|
6
7
|
import { MetricAlarmChart } from '../../chart/MetricAlarmChart';
|
|
7
|
-
import { IAmazonServerGroup, IScalingPolicyAlarm, IStepAdjustment } from '../../../../../domain';
|
|
8
|
+
import type { IAmazonServerGroup, IScalingPolicyAlarm, IStepAdjustment } from '../../../../../domain';
|
|
8
9
|
|
|
9
10
|
import './AlarmConfigurer.less';
|
|
10
11
|
|
|
@@ -19,7 +20,7 @@ export interface IAlarmConfigurerProps {
|
|
|
19
20
|
|
|
20
21
|
const STATISTICS = ['Average', 'Maximum', 'Minimum', 'SampleCount', 'Sum'];
|
|
21
22
|
|
|
22
|
-
const COMPARATORS = [
|
|
23
|
+
export const COMPARATORS = [
|
|
23
24
|
{ label: '>=', value: 'GreaterThanOrEqualToThreshold' },
|
|
24
25
|
{ label: '>', value: 'GreaterThanThreshold' },
|
|
25
26
|
{ label: '<=', value: 'LessThanOrEqualToThreshold' },
|
|
@@ -44,8 +45,7 @@ export const AlarmConfigurer = ({
|
|
|
44
45
|
updateAlarm,
|
|
45
46
|
}: IAlarmConfigurerProps) => {
|
|
46
47
|
const comparatorBound = alarm.comparisonOperator?.indexOf('Greater') === 0 ? 'max' : 'min';
|
|
47
|
-
const [
|
|
48
|
-
const [unit, setUnit] = React.useState<string>(alarmView?.unit);
|
|
48
|
+
const [unit, setUnit] = React.useState<string>(alarm?.unit);
|
|
49
49
|
const prevComparator = usePrevious(comparatorBound);
|
|
50
50
|
|
|
51
51
|
React.useEffect(() => {
|
|
@@ -64,24 +64,22 @@ export const AlarmConfigurer = ({
|
|
|
64
64
|
if (stepAdjustments?.length) {
|
|
65
65
|
const updatedStepAdjustments = [...stepAdjustments];
|
|
66
66
|
// Always set the first step at the alarm threshold
|
|
67
|
-
updatedStepAdjustments[0][source] =
|
|
67
|
+
updatedStepAdjustments[0][source] = alarm.threshold;
|
|
68
68
|
stepsChanged(updatedStepAdjustments);
|
|
69
69
|
}
|
|
70
|
-
}, [
|
|
70
|
+
}, [alarm.threshold]);
|
|
71
71
|
|
|
72
72
|
const onChartLoaded = (stats: ICloudMetricStatistics) => setUnit(stats.unit);
|
|
73
73
|
|
|
74
74
|
const onAlarmChange = (key: string, value: any) => {
|
|
75
75
|
const newAlarm = {
|
|
76
|
-
...
|
|
76
|
+
...alarm,
|
|
77
77
|
[key]: value,
|
|
78
78
|
};
|
|
79
|
-
setAlarmView(newAlarm);
|
|
80
79
|
updateAlarm(newAlarm);
|
|
81
80
|
};
|
|
82
81
|
|
|
83
82
|
const onMetricChange = (newAlarm: IScalingPolicyAlarm) => {
|
|
84
|
-
setAlarmView(newAlarm);
|
|
85
83
|
updateAlarm(newAlarm);
|
|
86
84
|
};
|
|
87
85
|
|
|
@@ -100,7 +98,7 @@ export const AlarmConfigurer = ({
|
|
|
100
98
|
</div>
|
|
101
99
|
</div>
|
|
102
100
|
)}
|
|
103
|
-
{
|
|
101
|
+
{alarm.alarmActionArns?.length > 1 && (
|
|
104
102
|
<div className="row">
|
|
105
103
|
<div className="col-md-12">
|
|
106
104
|
<div className="alert alert-warning">
|
|
@@ -116,21 +114,21 @@ export const AlarmConfigurer = ({
|
|
|
116
114
|
<div className="col-md-2 sm-label-right">Whenever</div>
|
|
117
115
|
<div className="col-md-10 horizontal">
|
|
118
116
|
<ReactSelectInput
|
|
119
|
-
value={
|
|
117
|
+
value={alarm.statistic}
|
|
120
118
|
onChange={(e) => onAlarmChange('statistic', e.target.value)}
|
|
121
119
|
stringOptions={STATISTICS}
|
|
122
120
|
clearable={false}
|
|
123
121
|
inputClassName="sp-margin-xs-right configurer-field-lg"
|
|
124
122
|
/>
|
|
125
123
|
<span className="input-label sp-margin-xs-right sp-margin-s-top"> of </span>
|
|
126
|
-
<MetricSelector alarm={
|
|
124
|
+
<MetricSelector alarm={alarm} serverGroup={serverGroup} updateAlarm={onMetricChange} />
|
|
127
125
|
</div>
|
|
128
126
|
</div>
|
|
129
127
|
<div className="row sp-margin-s-yaxis">
|
|
130
128
|
<div className="col-md-2 sm-label-right">is</div>
|
|
131
129
|
<div className="col-md-10 horizontal middle">
|
|
132
130
|
<ReactSelectInput
|
|
133
|
-
value={
|
|
131
|
+
value={alarm.comparisonOperator}
|
|
134
132
|
onChange={(e) => onAlarmChange('comparisonOperator', e.target.value)}
|
|
135
133
|
options={COMPARATORS}
|
|
136
134
|
clearable={false}
|
|
@@ -138,7 +136,7 @@ export const AlarmConfigurer = ({
|
|
|
138
136
|
/>
|
|
139
137
|
<div className="sp-margin-xl-left">
|
|
140
138
|
<NumberInput
|
|
141
|
-
value={
|
|
139
|
+
value={alarm.threshold}
|
|
142
140
|
onChange={(e) => onAlarmChange('threshold', Number.parseInt(e.target.value))}
|
|
143
141
|
inputClassName="sp-margin-xs-right configurer-field-lg"
|
|
144
142
|
/>
|
|
@@ -150,13 +148,13 @@ export const AlarmConfigurer = ({
|
|
|
150
148
|
<div className="col-md-2 sm-label-right">for at least</div>
|
|
151
149
|
<div className="col-md-10 horizontal middle">
|
|
152
150
|
<NumberInput
|
|
153
|
-
value={
|
|
151
|
+
value={alarm.evaluationPeriods}
|
|
154
152
|
onChange={(e) => onAlarmChange('evaluationPeriods', Number.parseInt(e.target.value))}
|
|
155
153
|
inputClassName="configurer-field-med number-input-field"
|
|
156
154
|
/>
|
|
157
155
|
<span className="input-label sp-margin-s-xaxis"> consecutive period(s) of </span>
|
|
158
156
|
<ReactSelectInput
|
|
159
|
-
value={
|
|
157
|
+
value={alarm.period}
|
|
160
158
|
onChange={(e) => onAlarmChange('period', e.target.value)}
|
|
161
159
|
options={PERIODS}
|
|
162
160
|
clearable={false}
|
|
@@ -168,7 +166,7 @@ export const AlarmConfigurer = ({
|
|
|
168
166
|
<div className="col-md-10 col-md-offset-1">
|
|
169
167
|
{alarm && (
|
|
170
168
|
<div>
|
|
171
|
-
<MetricAlarmChart alarm={
|
|
169
|
+
<MetricAlarmChart alarm={alarm} serverGroup={serverGroup} onChartLoaded={onChartLoaded} />
|
|
172
170
|
</div>
|
|
173
171
|
)}
|
|
174
172
|
</div>
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import { flatMap, uniq } from 'lodash';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { Subject } from 'rxjs';
|
|
3
|
+
import type { Subject } from 'rxjs';
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
IMetricAlarmDimension,
|
|
8
|
-
IServerGroup,
|
|
9
|
-
ReactSelectInput,
|
|
10
|
-
TextInput,
|
|
11
|
-
useData,
|
|
12
|
-
} from '@spinnaker/core';
|
|
5
|
+
import type { IMetricAlarmDimension, IServerGroup } from '@spinnaker/core';
|
|
6
|
+
import { CloudMetricsReader, ReactSelectInput, TextInput, useData } from '@spinnaker/core';
|
|
13
7
|
|
|
14
|
-
import { IScalingPolicyAlarmView } from '../../../../../domain';
|
|
8
|
+
import type { IScalingPolicyAlarmView } from '../../../../../domain';
|
|
15
9
|
|
|
16
10
|
import './dimensionsEditor.less';
|
|
17
11
|
|
|
@@ -23,37 +17,37 @@ export interface IDimensionsEditorProps {
|
|
|
23
17
|
}
|
|
24
18
|
|
|
25
19
|
export const DimensionsEditor = ({ alarm, serverGroup, updateAvailableMetrics }: IDimensionsEditorProps) => {
|
|
26
|
-
const
|
|
20
|
+
const dimensions = alarm.dimensions || [];
|
|
27
21
|
|
|
28
22
|
const fetchDimensions = () => {
|
|
29
23
|
return CloudMetricsReader.listMetrics('aws', serverGroup.account, serverGroup.region, {
|
|
30
24
|
namespace: alarm.namespace,
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
})
|
|
26
|
+
.then((results) => {
|
|
27
|
+
const allDimensions = flatMap(results, (r) => r.dimensions);
|
|
28
|
+
const sortedDimensions = uniq(allDimensions.filter((d) => d).map((d) => d.name)).sort();
|
|
29
|
+
return sortedDimensions;
|
|
30
|
+
})
|
|
31
|
+
.catch(() => {
|
|
32
|
+
return [];
|
|
33
|
+
});
|
|
36
34
|
};
|
|
37
35
|
const { result: dimensionOptions } = useData(fetchDimensions, [], [alarm.namespace, serverGroup.name]);
|
|
38
36
|
|
|
39
37
|
const addDimension = () => {
|
|
40
38
|
const newDimensions = [...dimensions, {} as IMetricAlarmDimension];
|
|
41
|
-
setDimensions(newDimensions);
|
|
42
39
|
updateAvailableMetrics(newDimensions);
|
|
43
40
|
};
|
|
44
41
|
const removeDimension = (index: number) => {
|
|
45
42
|
const newDimensions = alarm.dimensions.filter((_d, i) => i !== index);
|
|
46
|
-
setDimensions(newDimensions);
|
|
47
43
|
updateAvailableMetrics(newDimensions);
|
|
48
44
|
};
|
|
49
45
|
const updateDimension = (key: 'name' | 'value', value: string, index: number) => {
|
|
50
46
|
const newDimensions = [...dimensions];
|
|
51
47
|
const updatedDimension = newDimensions[index];
|
|
52
48
|
updatedDimension[key] = value;
|
|
53
|
-
setDimensions(newDimensions);
|
|
54
49
|
updateAvailableMetrics(newDimensions);
|
|
55
50
|
};
|
|
56
|
-
|
|
57
51
|
return (
|
|
58
52
|
<div>
|
|
59
53
|
<div className="row">
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
import { Dictionary } from 'lodash';
|
|
1
|
+
import type { Dictionary } from 'lodash';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
HelpField,
|
|
7
|
-
ICloudMetricDescriptor,
|
|
8
|
-
IMetricAlarmDimension,
|
|
9
|
-
ReactSelectInput,
|
|
10
|
-
useData,
|
|
11
|
-
} from '@spinnaker/core';
|
|
4
|
+
import type { ICloudMetricDescriptor, IMetricAlarmDimension } from '@spinnaker/core';
|
|
5
|
+
import { CloudMetricsReader, HelpField, ReactSelectInput, useData } from '@spinnaker/core';
|
|
12
6
|
|
|
13
7
|
import { DimensionsEditor } from './DimensionsEditor';
|
|
14
8
|
import { AWSProviderSettings } from '../../../../../aws.settings';
|
|
15
|
-
import { IAmazonServerGroup, IScalingPolicyAlarmView } from '../../../../../domain';
|
|
9
|
+
import type { IAmazonServerGroup, IScalingPolicyAlarmView } from '../../../../../domain';
|
|
16
10
|
import { NAMESPACES } from './namespaces';
|
|
17
11
|
|
|
18
12
|
import './MetricSelector.less';
|
|
@@ -32,10 +26,6 @@ export interface IMetricSelectorProps {
|
|
|
32
26
|
export const MetricSelector = ({ alarm, updateAlarm, serverGroup }: IMetricSelectorProps) => {
|
|
33
27
|
const namespaces = (AWSProviderSettings?.metrics?.customNamespaces || []).concat(NAMESPACES);
|
|
34
28
|
const [advancedMode, setAdvancedMode] = React.useState<boolean>(false);
|
|
35
|
-
// TODO: Remove useState once rendering speed improve (after refactoring to React)
|
|
36
|
-
const [selectedMetric, setSelectedMetric] = React.useState({});
|
|
37
|
-
const [metricName, setMetricName] = React.useState<string>(alarm?.metricName);
|
|
38
|
-
const [namespace, setNamespace] = React.useState<string>(alarm?.namespace);
|
|
39
29
|
|
|
40
30
|
const dimensionsObject = (alarm?.dimensions || []).reduce(
|
|
41
31
|
(acc: Dictionary<string>, dimension: IMetricAlarmDimension) => {
|
|
@@ -50,49 +40,35 @@ export const MetricSelector = ({ alarm, updateAlarm, serverGroup }: IMetricSelec
|
|
|
50
40
|
.sort((a: IMetricAlarmDimension, b: IMetricAlarmDimension) => a.name?.localeCompare(b.name))
|
|
51
41
|
.map((d: IMetricAlarmDimension) => d.value)
|
|
52
42
|
.join(', ');
|
|
53
|
-
const dimensionValuesStr = buildDimensionValues(alarm?.dimensions || []);
|
|
54
43
|
|
|
55
44
|
const fetchCloudMetrics = () => {
|
|
56
45
|
const account = serverGroup.cloudProvider === 'aws' ? serverGroup.account : serverGroup?.awsAccount;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
46
|
+
const queryParams = advancedMode ? { namespace: alarm?.namespace } : { AutoScalingGroupName: serverGroup.name };
|
|
47
|
+
return CloudMetricsReader.listMetrics('aws', account, serverGroup.region, queryParams)
|
|
48
|
+
.then((results: ICloudMetricDescriptor[]) => {
|
|
49
|
+
const sortedMetrics: IMetricOption[] = (results || [])
|
|
60
50
|
.map((m) => ({
|
|
61
51
|
label: `(${m.namespace}) ${m.name}`,
|
|
62
52
|
dimensions: [],
|
|
63
|
-
dimensionValues: buildDimensionValues(m.dimensions),
|
|
53
|
+
dimensionValues: buildDimensionValues(m.dimensions || []),
|
|
64
54
|
value: m,
|
|
65
55
|
...m,
|
|
66
56
|
}))
|
|
67
57
|
.sort((a, b) => a.label?.localeCompare(b.label));
|
|
68
|
-
|
|
69
|
-
const chosenMetric =
|
|
70
|
-
sortedMetrics.find(
|
|
71
|
-
(m: IMetricOption) =>
|
|
72
|
-
m.name === alarm?.metricName &&
|
|
73
|
-
m.namespace === alarm?.namespace &&
|
|
74
|
-
m.dimensionValues === dimensionValuesStr,
|
|
75
|
-
) ||
|
|
76
|
-
sortedMetrics.find((m) => m.name.match('CPUUtilization')) ||
|
|
77
|
-
sortedMetrics[0];
|
|
78
|
-
setSelectedMetric(chosenMetric);
|
|
79
|
-
setMetricName(chosenMetric.name);
|
|
80
|
-
setNamespace(chosenMetric.namespace);
|
|
81
|
-
|
|
82
|
-
const newAlarm = {
|
|
83
|
-
...alarm,
|
|
84
|
-
metricName: chosenMetric.name,
|
|
85
|
-
namespace: chosenMetric.namespace,
|
|
86
|
-
dimensions: chosenMetric.dimensions,
|
|
87
|
-
};
|
|
88
|
-
updateAlarm(newAlarm);
|
|
89
58
|
return sortedMetrics;
|
|
90
|
-
}
|
|
91
|
-
|
|
59
|
+
})
|
|
60
|
+
.catch(() => {
|
|
61
|
+
return [];
|
|
62
|
+
});
|
|
92
63
|
};
|
|
93
64
|
|
|
94
65
|
const { result: metrics } = useData(fetchCloudMetrics, [], [serverGroup, alarm?.namespace]);
|
|
95
|
-
|
|
66
|
+
const metricsByNamespace = (metrics || []).filter((m) => m.namespace === alarm?.namespace);
|
|
67
|
+
const selectedMetric =
|
|
68
|
+
metricsByNamespace.find((m: IMetricOption) => m.name === alarm?.metricName && m.namespace === alarm?.namespace) ||
|
|
69
|
+
metricsByNamespace.find((m) => m.name.match('CPUUtilization')) ||
|
|
70
|
+
metricsByNamespace[0];
|
|
71
|
+
const { name: metricName, namespace } = selectedMetric || {};
|
|
96
72
|
|
|
97
73
|
const toggleMode = () => {
|
|
98
74
|
const newMode = !advancedMode;
|
|
@@ -115,11 +91,6 @@ export const MetricSelector = ({ alarm, updateAlarm, serverGroup }: IMetricSelec
|
|
|
115
91
|
namespace: metric.namespace,
|
|
116
92
|
dimensions: metric.dimensions,
|
|
117
93
|
};
|
|
118
|
-
|
|
119
|
-
const newMetric = metrics.find((m) => m.namespace === metric.namespace && m.name === metric.name);
|
|
120
|
-
setSelectedMetric(newMetric);
|
|
121
|
-
setMetricName(newMetric.name);
|
|
122
|
-
setNamespace(newMetric.namespace);
|
|
123
94
|
updateAlarm(newAlarm);
|
|
124
95
|
};
|
|
125
96
|
|
|
@@ -129,8 +100,6 @@ export const MetricSelector = ({ alarm, updateAlarm, serverGroup }: IMetricSelec
|
|
|
129
100
|
metricName: newName,
|
|
130
101
|
namespace: newNamespace,
|
|
131
102
|
};
|
|
132
|
-
setMetricName(newName);
|
|
133
|
-
setNamespace(newNamespace);
|
|
134
103
|
updateAlarm(newAlarm);
|
|
135
104
|
};
|
|
136
105
|
|
|
@@ -141,6 +110,13 @@ export const MetricSelector = ({ alarm, updateAlarm, serverGroup }: IMetricSelec
|
|
|
141
110
|
};
|
|
142
111
|
updateAlarm(newAlarm);
|
|
143
112
|
};
|
|
113
|
+
|
|
114
|
+
React.useEffect(() => {
|
|
115
|
+
if (selectedMetric) {
|
|
116
|
+
onMetricChange(selectedMetric);
|
|
117
|
+
}
|
|
118
|
+
}, [selectedMetric]);
|
|
119
|
+
|
|
144
120
|
if (!advancedMode) {
|
|
145
121
|
return (
|
|
146
122
|
<div className="MetricSelector horizontal middle">
|
|
@@ -4,3 +4,4 @@ export * from './alarm/MetricSelector';
|
|
|
4
4
|
export * from './PolicyTypeSelectionModal';
|
|
5
5
|
export * from './ScalingPolicyAdditionalSettings';
|
|
6
6
|
export * from './step/StepPolicyAction';
|
|
7
|
+
export { UpsertScalingPolicyModal as AmazonUpsertScalingPolicyModal } from './UpsertScalingPolicyModal';
|
|
@@ -24,17 +24,15 @@ export const SimplePolicyAction = ({
|
|
|
24
24
|
}: ISimplePolicyActionProps) => {
|
|
25
25
|
const availableActions = ['Add', 'Remove', 'Set to'];
|
|
26
26
|
|
|
27
|
-
const [
|
|
28
|
-
const adjustmentTypeOptions = action === 'Set to' ? ['instances'] : ['instances', 'percent of group'];
|
|
27
|
+
const adjustmentTypeOptions = operator === 'Set to' ? ['instances'] : ['instances', 'percent of group'];
|
|
29
28
|
const onActionChange = (val: Operator) => {
|
|
30
|
-
setAction(val);
|
|
31
29
|
adjustmentTypeChanged(val, adjustmentType);
|
|
32
30
|
};
|
|
33
31
|
|
|
34
32
|
const [adjustmentTypeView, setAdjustmentTypeView] = React.useState<AdjustmentTypeView>(adjustmentType);
|
|
35
33
|
const onAdjustmentTypeChange = (type: AdjustmentTypeView) => {
|
|
36
34
|
setAdjustmentTypeView(type);
|
|
37
|
-
adjustmentTypeChanged(
|
|
35
|
+
adjustmentTypeChanged(operator, type);
|
|
38
36
|
};
|
|
39
37
|
|
|
40
38
|
const [adjustment, setAdjustment] = React.useState<number>(scalingAdjustment);
|
|
@@ -47,7 +45,7 @@ export const SimplePolicyAction = ({
|
|
|
47
45
|
<div className="SimplePolicyAction row">
|
|
48
46
|
<div className="col-md-10 col-md-offset-1 horizontal middle">
|
|
49
47
|
<ReactSelectInput
|
|
50
|
-
value={
|
|
48
|
+
value={operator}
|
|
51
49
|
stringOptions={availableActions}
|
|
52
50
|
onChange={(e) => onActionChange(e.target.value)}
|
|
53
51
|
clearable={false}
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { NumberInput, ReactSelectInput } from '@spinnaker/core';
|
|
4
4
|
|
|
5
|
-
import { IScalingPolicyAlarm, IStepAdjustment } from '../../../../../domain';
|
|
5
|
+
import type { IScalingPolicyAlarm, IStepAdjustment } from '../../../../../domain';
|
|
6
6
|
|
|
7
7
|
import './StepPolicyAction.less';
|
|
8
8
|
|
|
@@ -33,50 +33,40 @@ export const StepPolicyAction = ({
|
|
|
33
33
|
const hasEqualTo = alarm?.comparisonOperator.includes('Equal');
|
|
34
34
|
const availableActions = ['Add', 'Remove', 'Set to'];
|
|
35
35
|
|
|
36
|
-
const [
|
|
37
|
-
const adjustmentTypeOptions = action === 'Set to' ? ['instances'] : ['instances', 'percent of group'];
|
|
36
|
+
const adjustmentTypeOptions = operator === 'Set to' ? ['instances'] : ['instances', 'percent of group'];
|
|
38
37
|
const onActionChange = (val: Operator) => {
|
|
39
|
-
setAction(val);
|
|
40
38
|
adjustmentTypeChanged(val, adjustmentType);
|
|
41
39
|
};
|
|
42
40
|
|
|
43
|
-
const [adjustmentTypeView, setAdjustmentTypeView] = React.useState<AdjustmentTypeView>(adjustmentType);
|
|
44
41
|
const onAdjustmentTypeChange = (type: AdjustmentTypeView) => {
|
|
45
|
-
|
|
46
|
-
adjustmentTypeChanged(action, type);
|
|
42
|
+
adjustmentTypeChanged(operator, type);
|
|
47
43
|
};
|
|
48
44
|
|
|
49
|
-
const
|
|
45
|
+
const steps = step?.stepAdjustments || stepAdjustments;
|
|
50
46
|
const addStep = () => {
|
|
51
47
|
const newStep = { scalingAdjustment: 1 } as IStepAdjustment;
|
|
52
48
|
const newSteps = [...steps, newStep];
|
|
53
|
-
setSteps(newSteps);
|
|
54
49
|
stepsChanged(newSteps);
|
|
55
50
|
};
|
|
56
51
|
const removeStep = (index: number) => {
|
|
57
52
|
const newSteps = steps.filter((_s, i) => i !== index);
|
|
58
|
-
setSteps(newSteps);
|
|
59
53
|
stepsChanged(newSteps);
|
|
60
54
|
};
|
|
61
55
|
const updateStep = (updatedStep: IStepAdjustment, index: number) => {
|
|
62
56
|
const newSteps = [...steps];
|
|
63
57
|
newSteps[index] = updatedStep;
|
|
64
|
-
setSteps(newSteps);
|
|
65
58
|
stepsChanged(newSteps);
|
|
66
59
|
};
|
|
67
60
|
|
|
68
|
-
React.useEffect(() => {
|
|
69
|
-
setSteps(step.stepAdjustments);
|
|
70
|
-
}, [step?.stepAdjustments]);
|
|
71
61
|
return (
|
|
72
62
|
<div className="StepPolicyAction row">
|
|
73
63
|
{steps?.map((step: IStepAdjustment, index: number) => (
|
|
74
64
|
<div key={`step-adjustment-${index}`} className="step-policy-row col-md-10 col-md-offset-1 horizontal middle">
|
|
75
65
|
{Boolean(index) ? (
|
|
76
|
-
<span className="action-input sp-margin-xs-left">{
|
|
66
|
+
<span className="action-input sp-margin-xs-left">{operator}</span>
|
|
77
67
|
) : (
|
|
78
68
|
<ReactSelectInput
|
|
79
|
-
value={
|
|
69
|
+
value={operator}
|
|
80
70
|
stringOptions={availableActions}
|
|
81
71
|
onChange={(e) => onActionChange(e.target.value)}
|
|
82
72
|
clearable={false}
|
|
@@ -90,10 +80,10 @@ export const StepPolicyAction = ({
|
|
|
90
80
|
inputClassName="action-input"
|
|
91
81
|
/>
|
|
92
82
|
{Boolean(index) ? (
|
|
93
|
-
<span className="sp-margin-xs-left">{
|
|
83
|
+
<span className="sp-margin-xs-left">{adjustmentType}</span>
|
|
94
84
|
) : (
|
|
95
85
|
<ReactSelectInput
|
|
96
|
-
value={
|
|
86
|
+
value={adjustmentType}
|
|
97
87
|
stringOptions={adjustmentTypeOptions}
|
|
98
88
|
onChange={(e) => onAdjustmentTypeChange(e.target.value)}
|
|
99
89
|
clearable={false}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { CollapsibleSection, confirmNotManaged, ModalInjector } from '@spinnaker/core';
|
|
3
|
+
import { CollapsibleSection, confirmNotManaged, ModalInjector, SETTINGS } from '@spinnaker/core';
|
|
4
4
|
import { HelpField } from '@spinnaker/core';
|
|
5
5
|
|
|
6
|
-
import { IAmazonServerGroupDetailsSectionProps } from './IAmazonServerGroupDetailsSectionProps';
|
|
6
|
+
import type { IAmazonServerGroupDetailsSectionProps } from './IAmazonServerGroupDetailsSectionProps';
|
|
7
7
|
|
|
8
8
|
export class AdvancedSettingsDetailsSection extends React.Component<IAmazonServerGroupDetailsSectionProps> {
|
|
9
9
|
private editAdvancedSettings = (): void => {
|
|
@@ -49,9 +49,11 @@ export class AdvancedSettingsDetailsSection extends React.Component<IAmazonServe
|
|
|
49
49
|
<dd>{`${asg.capacityRebalance}`}</dd>,
|
|
50
50
|
]}
|
|
51
51
|
</dl>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
{SETTINGS.awsAdHocInfraWritesEnabled && (
|
|
53
|
+
<a className="clickable" onClick={this.editAdvancedSettings}>
|
|
54
|
+
Edit Advanced Settings
|
|
55
|
+
</a>
|
|
56
|
+
)}
|
|
55
57
|
</CollapsibleSection>
|
|
56
58
|
);
|
|
57
59
|
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
+
import type { ICapacity } from '@spinnaker/core';
|
|
3
4
|
import {
|
|
4
5
|
CapacityDetailsSection,
|
|
5
6
|
CollapsibleSection,
|
|
6
|
-
ICapacity,
|
|
7
7
|
Overridable,
|
|
8
|
+
SETTINGS,
|
|
8
9
|
ViewScalingActivitiesLink,
|
|
9
10
|
} from '@spinnaker/core';
|
|
10
11
|
|
|
11
|
-
import { IAmazonServerGroupDetailsSectionProps } from './IAmazonServerGroupDetailsSectionProps';
|
|
12
|
+
import type { IAmazonServerGroupDetailsSectionProps } from './IAmazonServerGroupDetailsSectionProps';
|
|
12
13
|
import { AmazonResizeServerGroupModal } from '../resize/AmazonResizeServerGroupModal';
|
|
13
14
|
|
|
14
15
|
@Overridable('amazon.serverGroup.CapacityDetailsSection')
|
|
@@ -27,9 +28,11 @@ export class AmazonCapacityDetailsSection extends React.Component<IAmazonServerG
|
|
|
27
28
|
<CapacityDetailsSection current={serverGroup.instances.length} capacity={capacity} />
|
|
28
29
|
|
|
29
30
|
<div>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
{SETTINGS.awsAdHocInfraWritesEnabled && (
|
|
32
|
+
<a className="clickable" onClick={() => AmazonResizeServerGroupModal.show({ application, serverGroup })}>
|
|
33
|
+
Resize Server Group
|
|
34
|
+
</a>
|
|
35
|
+
)}
|
|
33
36
|
</div>
|
|
34
37
|
|
|
35
38
|
<div>
|