-
Notifications
You must be signed in to change notification settings - Fork 705
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(kayenta/aws): First pass at support for configuring AWS canary s…
…ervice integration. (#892)
- Loading branch information
Matt Duftler
authored
Apr 4, 2018
1 parent
54052d2
commit 013c4c2
Showing
17 changed files
with
652 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...netflix/spinnaker/halyard/cli/command/v1/config/canary/CommonCanaryCommandProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright 2018 Google, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License") | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.netflix.spinnaker.halyard.cli.command.v1.config.canary; | ||
|
||
public class CommonCanaryCommandProperties { | ||
public static final String ROOT_FOLDER = "The root folder in the chosen bucket to place all of the canary service's persistent data in " | ||
+ "(*Default*: `kayenta`)."; | ||
} |
61 changes: 61 additions & 0 deletions
61
...java/com/netflix/spinnaker/halyard/cli/command/v1/config/canary/aws/CanaryAwsCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* Copyright 2018 Google, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License") | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.netflix.spinnaker.halyard.cli.command.v1.config.canary.aws; | ||
|
||
import com.beust.jcommander.Parameters; | ||
import com.netflix.spinnaker.halyard.cli.command.v1.config.AbstractConfigCommand; | ||
import com.netflix.spinnaker.halyard.cli.command.v1.config.canary.EnableDisableCanaryServiceIntegrationCommandBuilder; | ||
import com.netflix.spinnaker.halyard.cli.command.v1.config.canary.aws.account.AwsCanaryAccountCommand; | ||
import com.netflix.spinnaker.halyard.cli.services.v1.Daemon; | ||
import com.netflix.spinnaker.halyard.cli.services.v1.OperationHandler; | ||
import com.netflix.spinnaker.halyard.cli.ui.v1.AnsiFormatUtils; | ||
import com.netflix.spinnaker.halyard.config.model.v1.canary.Canary; | ||
import com.netflix.spinnaker.halyard.config.model.v1.canary.aws.AwsCanaryServiceIntegration; | ||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
|
||
@Parameters(separators = "=") | ||
@Data | ||
@EqualsAndHashCode(callSuper = false) | ||
public class CanaryAwsCommand extends AbstractConfigCommand { | ||
|
||
String commandName = AwsCanaryServiceIntegration.NAME; | ||
|
||
String shortDescription = "Configure your canary analysis AWS service integration settings for Spinnaker."; | ||
|
||
String longDescription = shortDescription; | ||
|
||
public CanaryAwsCommand() { | ||
registerSubcommand(new EditCanaryAwsCommand()); | ||
registerSubcommand(new EnableDisableCanaryServiceIntegrationCommandBuilder().setName("AWS").setEnable(true).build()); | ||
registerSubcommand(new EnableDisableCanaryServiceIntegrationCommandBuilder().setName("AWS").setEnable(false).build()); | ||
registerSubcommand(new AwsCanaryAccountCommand()); | ||
} | ||
|
||
@Override | ||
protected void executeThis() { | ||
String currentDeployment = getCurrentDeployment(); | ||
|
||
new OperationHandler<Canary>() | ||
.setOperation(Daemon.getCanary(currentDeployment, !noValidate)) | ||
.setFailureMesssage("Failed to load canary settings.") | ||
.setSuccessMessage("Configured canary settings: ") | ||
.setFormat(AnsiFormatUtils.Format.STRING) | ||
.setUserFormatted(true) | ||
.get(); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
.../spinnaker/halyard/cli/command/v1/config/canary/aws/CommonCanaryAwsCommandProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Copyright 2018 Google, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License") | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.netflix.spinnaker.halyard.cli.command.v1.config.canary.aws; | ||
|
||
public class CommonCanaryAwsCommandProperties { | ||
public static final String BUCKET = "The name of a storage bucket that your specified account has access to."; | ||
} |
Oops, something went wrong.