Skip to content

Commit

Permalink
feat(kayenta/aws): First pass at support for configuring AWS canary s…
Browse files Browse the repository at this point in the history
…ervice integration. (#892)
  • Loading branch information
Matt Duftler authored Apr 4, 2018
1 parent 54052d2 commit 013c4c2
Show file tree
Hide file tree
Showing 17 changed files with 652 additions and 8 deletions.
182 changes: 182 additions & 0 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@
* [**hal config artifact http disable**](#hal-config-artifact-http-disable)
* [**hal config artifact http enable**](#hal-config-artifact-http-enable)
* [**hal config canary**](#hal-config-canary)
* [**hal config canary aws**](#hal-config-canary-aws)
* [**hal config canary aws account**](#hal-config-canary-aws-account)
* [**hal config canary aws account add**](#hal-config-canary-aws-account-add)
* [**hal config canary aws account delete**](#hal-config-canary-aws-account-delete)
* [**hal config canary aws account edit**](#hal-config-canary-aws-account-edit)
* [**hal config canary aws account get**](#hal-config-canary-aws-account-get)
* [**hal config canary aws account list**](#hal-config-canary-aws-account-list)
* [**hal config canary aws disable**](#hal-config-canary-aws-disable)
* [**hal config canary aws edit**](#hal-config-canary-aws-edit)
* [**hal config canary aws enable**](#hal-config-canary-aws-enable)
* [**hal config canary datadog**](#hal-config-canary-datadog)
* [**hal config canary datadog account**](#hal-config-canary-datadog-account)
* [**hal config canary datadog account add**](#hal-config-canary-datadog-account-add)
Expand Down Expand Up @@ -1059,13 +1069,185 @@ hal config canary [parameters] [subcommands]
* `--no-validate`: (*Default*: `false`) Skip validation.

#### Subcommands
* `aws`: Configure your canary analysis AWS service integration settings for Spinnaker.
* `datadog`: Configure your canary analysis Datadog service integration settings for Spinnaker.
* `disable`: Set Spinnaker's canary analysis to disabled.
* `edit`: Edit Spinnaker's canary analysis settings.
* `enable`: Set Spinnaker's canary analysis to enabled.
* `google`: Configure your canary analysis Google service integration settings for Spinnaker.
* `prometheus`: Configure your canary analysis Prometheus service integration settings for Spinnaker.

---
## hal config canary aws

Configure your canary analysis AWS service integration settings for Spinnaker.

#### Usage
```
hal config canary aws [parameters] [subcommands]
```

#### Parameters
* `--deployment`: If supplied, use this Halyard deployment. This will _not_ create a new deployment.
* `--no-validate`: (*Default*: `false`) Skip validation.

#### Subcommands
* `account`: Manage and view Spinnaker configuration for the AWS service integration's canary accounts.
* `disable`: Set Spinnaker's canary analysis AWS service integration to disabled.
* `edit`: Edit Spinnaker's canary analysis AWS service integration settings.
* `enable`: Set Spinnaker's canary analysis AWS service integration to enabled.

---
## hal config canary aws account

Manage and view Spinnaker configuration for the AWS service integration's canary accounts.

#### Usage
```
hal config canary aws account ACCOUNT [parameters] [subcommands]
```

#### Parameters
`ACCOUNT`: The name of the canary account to operate on.
* `--deployment`: If supplied, use this Halyard deployment. This will _not_ create a new deployment.
* `--no-validate`: (*Default*: `false`) Skip validation.

#### Subcommands
* `add`: Add a canary account to the AWS service integration.
* `delete`: Delete a specific AWS canary account by name.
* `edit`: Edit a canary account in the AWS service integration.
* `get`: Get the specified canary account details for the AWS service integration.
* `list`: List the canary account names for the AWS service integration.

---
## hal config canary aws account add

Add a canary account to the AWS service integration.

#### Usage
```
hal config canary aws account add ACCOUNT [parameters]
```

#### Parameters
`ACCOUNT`: The name of the canary account to operate on.
* `--bucket`: (*Required*) The name of a storage bucket that your specified account has access to.
* `--deployment`: If supplied, use this Halyard deployment. This will _not_ create a new deployment.
* `--no-validate`: (*Default*: `false`) Skip validation.
* `--root-folder`: The root folder in the chosen bucket to place all of the canary service's persistent data in (*Default*: `kayenta`).


---
## hal config canary aws account delete

Delete a specific AWS canary account by name.

#### Usage
```
hal config canary aws account delete ACCOUNT [parameters]
```

#### Parameters
`ACCOUNT`: The name of the canary account to operate on.
* `--deployment`: If supplied, use this Halyard deployment. This will _not_ create a new deployment.
* `--no-validate`: (*Default*: `false`) Skip validation.


---
## hal config canary aws account edit

Edit a canary account in the AWS service integration.

#### Usage
```
hal config canary aws account edit ACCOUNT [parameters]
```

#### Parameters
`ACCOUNT`: The name of the canary account to operate on.
* `--bucket`: The name of a storage bucket that your specified account has access to.
* `--deployment`: If supplied, use this Halyard deployment. This will _not_ create a new deployment.
* `--no-validate`: (*Default*: `false`) Skip validation.
* `--root-folder`: The root folder in the chosen bucket to place all of the canary service's persistent data in (*Default*: `kayenta`).


---
## hal config canary aws account get

Get the specified canary account details for the AWS service integration.

#### Usage
```
hal config canary aws account get ACCOUNT [parameters]
```

#### Parameters
`ACCOUNT`: The name of the canary account to operate on.
* `--deployment`: If supplied, use this Halyard deployment. This will _not_ create a new deployment.
* `--no-validate`: (*Default*: `false`) Skip validation.


---
## hal config canary aws account list

List the canary account names for the AWS service integration.

#### Usage
```
hal config canary aws account list [parameters]
```

#### Parameters
* `--deployment`: If supplied, use this Halyard deployment. This will _not_ create a new deployment.
* `--no-validate`: (*Default*: `false`) Skip validation.


---
## hal config canary aws disable

Set Spinnaker's canary analysis AWS service integration to disabled.

#### Usage
```
hal config canary aws disable [parameters]
```

#### Parameters
* `--deployment`: If supplied, use this Halyard deployment. This will _not_ create a new deployment.
* `--no-validate`: (*Default*: `false`) Skip validation.


---
## hal config canary aws edit

Edit Spinnaker's canary analysis AWS service integration settings.

#### Usage
```
hal config canary aws edit [parameters]
```

#### Parameters
* `--deployment`: If supplied, use this Halyard deployment. This will _not_ create a new deployment.
* `--no-validate`: (*Default*: `false`) Skip validation.
* `--s3-enabled`: Whether or not to enable S3 as a persistent store (*Default*: `false`).


---
## hal config canary aws enable

Set Spinnaker's canary analysis AWS service integration to enabled.

#### Usage
```
hal config canary aws enable [parameters]
```

#### Parameters
* `--deployment`: If supplied, use this Halyard deployment. This will _not_ create a new deployment.
* `--no-validate`: (*Default*: `false`) Skip validation.


---
## hal config canary datadog

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

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.aws.CanaryAwsCommand;
import com.netflix.spinnaker.halyard.cli.command.v1.config.canary.datadog.CanaryDatadogCommand;
import com.netflix.spinnaker.halyard.cli.command.v1.config.canary.google.CanaryGoogleCommand;
import com.netflix.spinnaker.halyard.cli.command.v1.config.canary.prometheus.CanaryPrometheusCommand;
Expand Down Expand Up @@ -46,6 +47,7 @@ public CanaryCommand() {
registerSubcommand(new CanaryGoogleCommand());
registerSubcommand(new CanaryPrometheusCommand());
registerSubcommand(new CanaryDatadogCommand());
registerSubcommand(new CanaryAwsCommand());
}

@Override
Expand Down
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`).";
}
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();
}
}
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.";
}
Loading

0 comments on commit 013c4c2

Please sign in to comment.