diff --git a/docs/commands.md b/docs/commands.md index 8723a64d6e..3d1c51d1ab 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -102,6 +102,15 @@ * [**hal config canary datadog account list**](#hal-config-canary-datadog-account-list) * [**hal config canary datadog disable**](#hal-config-canary-datadog-disable) * [**hal config canary datadog enable**](#hal-config-canary-datadog-enable) + * [**hal config canary signalfx**](#hal-config-canary-signalfx) + * [**hal config canary signalfx account**](#hal-config-canary-signalfx-account) + * [**hal config canary signalfx account add**](#hal-config-canary-signalfx-account-add) + * [**hal config canary signalfx account delete**](#hal-config-canary-signalfx-account-delete) + * [**hal config canary signalfx account edit**](#hal-config-canary-signalfx-account-edit) + * [**hal config canary signalfx account get**](#hal-config-canary-signalfx-account-get) + * [**hal config canary signalfx account list**](#hal-config-canary-signalfx-account-list) + * [**hal config canary signalfx disable**](#hal-config-canary-signalfx-disable) + * [**hal config canary signalfx enable**](#hal-config-canary-signalfx-enable) * [**hal config canary disable**](#hal-config-canary-disable) * [**hal config canary edit**](#hal-config-canary-edit) * [**hal config canary enable**](#hal-config-canary-enable) @@ -1793,6 +1802,7 @@ hal config canary [parameters] [subcommands] * `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. + * `signalfx`: Configure your canary analysis SignalFx service integration settings for Spinnaker. --- ## hal config canary aws @@ -2533,6 +2543,160 @@ hal config canary prometheus enable [parameters] * `--no-validate`: (*Default*: `false`) Skip validation. +--- +## hal config canary signalfx + +Configure your canary analysis SignalFx service integration settings for Spinnaker. + +#### Usage +``` +hal config canary signalfx [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 SignalFx service integration's canary accounts. + * `disable`: Set Spinnaker's canary analysis SignalFx service integration to disabled. + * `enable`: Set Spinnaker's canary analysis SignalFx service integration to enabled. + +--- +## hal config canary signalfx account + +Manage and view Spinnaker configuration for the SignalFx service integration's canary accounts. + +#### Usage +``` +hal config canary signalfx 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 SignalFx service integration. + * `delete`: Delete a specific SignalFx canary account by name. + * `edit`: Edit a canary account in the SignalFx service integration. + * `get`: Get the specified canary account details for the SignalFx service integration. + * `list`: List the canary account names for the SignalFx service integration. + +--- +## hal config canary signalfx account add + +Add a canary account to the SignalFx service integration. + +#### Usage +``` +hal config canary signalfx account add ACCOUNT [parameters] +``` + +#### Parameters +`ACCOUNT`: The name of the canary account to operate on. + * `--access-token`: (*Required*) (*Sensitive data* - user will be prompted on standard input) The SignalFx access token. + * `--base-url`: (*Required*) The base URL to the SignalFx server. + * `--deployment`: If supplied, use this Halyard deployment. This will _not_ create a new deployment. + * `--no-validate`: (*Default*: `false`) Skip validation. + + +--- +## hal config canary signalfx account delete + +Delete a specific SignalFx canary account by name. + +#### Usage +``` +hal config canary signalfx 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 signalfx account edit + +Edit a canary account in the SignalFx service integration. + +#### Usage +``` +hal config canary signalfx account edit ACCOUNT [parameters] +``` + +#### Parameters +`ACCOUNT`: The name of the canary account to operate on. + * `--access-token`: (*Sensitive data* - user will be prompted on standard input) The SignalFx access token. + * `--base-url`: The base URL to the SignalFx server. + * `--deployment`: If supplied, use this Halyard deployment. This will _not_ create a new deployment. + * `--no-validate`: (*Default*: `false`) Skip validation. + + +--- +## hal config canary signalfx account get + +Get the specified canary account details for the SignalFx service integration. + +#### Usage +``` +hal config canary signalfx 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 signalfx account list + +List the canary account names for the SignalFx service integration. + +#### Usage +``` +hal config canary signalfx 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 signalfx disable + +Set Spinnaker's canary analysis SignalFx service integration to disabled. + +#### Usage +``` +hal config canary signalfx 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 signalfx enable + +Set Spinnaker's canary analysis SignalFx service integration to enabled. + +#### Usage +``` +hal config canary signalfx 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 ci diff --git a/halyard-cli/src/main/java/com/netflix/spinnaker/halyard/cli/command/v1/config/canary/CanaryCommand.java b/halyard-cli/src/main/java/com/netflix/spinnaker/halyard/cli/command/v1/config/canary/CanaryCommand.java index 84b8c72418..51920cacca 100644 --- a/halyard-cli/src/main/java/com/netflix/spinnaker/halyard/cli/command/v1/config/canary/CanaryCommand.java +++ b/halyard-cli/src/main/java/com/netflix/spinnaker/halyard/cli/command/v1/config/canary/CanaryCommand.java @@ -22,6 +22,7 @@ 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; +import com.netflix.spinnaker.halyard.cli.command.v1.config.canary.signalfx.CanarySignalfxCommand; 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; @@ -47,6 +48,7 @@ public CanaryCommand() { registerSubcommand(new CanaryGoogleCommand()); registerSubcommand(new CanaryPrometheusCommand()); registerSubcommand(new CanaryDatadogCommand()); + registerSubcommand(new CanarySignalfxCommand()); registerSubcommand(new CanaryAwsCommand()); } diff --git a/halyard-cli/src/main/java/com/netflix/spinnaker/halyard/cli/command/v1/config/canary/signalfx/CanarySignalfxCommand.java b/halyard-cli/src/main/java/com/netflix/spinnaker/halyard/cli/command/v1/config/canary/signalfx/CanarySignalfxCommand.java new file mode 100644 index 0000000000..ae6ba2cc13 --- /dev/null +++ b/halyard-cli/src/main/java/com/netflix/spinnaker/halyard/cli/command/v1/config/canary/signalfx/CanarySignalfxCommand.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2018 Nike, 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.signalfx; + +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.signalfx.account.SignalfxCanaryAccountCommand; +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.signalfx.SignalfxCanaryServiceIntegration; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Parameters(separators = "=") +@Data +@EqualsAndHashCode(callSuper = false) +public class CanarySignalfxCommand extends AbstractConfigCommand { + + String commandName = SignalfxCanaryServiceIntegration.NAME; + + String shortDescription = "Configure your canary analysis SignalFx service integration settings for Spinnaker."; + + String longDescription = shortDescription; + + public CanarySignalfxCommand() { + registerSubcommand(new EnableDisableCanaryServiceIntegrationCommandBuilder().setName("Signalfx").setEnable(true).build()); + registerSubcommand(new EnableDisableCanaryServiceIntegrationCommandBuilder().setName("Signalfx").setEnable(false).build()); + registerSubcommand(new SignalfxCanaryAccountCommand()); + } + + @Override + protected void executeThis() { + String currentDeployment = getCurrentDeployment(); + + new OperationHandler() + .setOperation(Daemon.getCanary(currentDeployment, !noValidate)) + .setFailureMesssage("Failed to load canary settings.") + .setSuccessMessage("Configured canary settings: ") + .setFormat(AnsiFormatUtils.Format.STRING) + .setUserFormatted(true) + .get(); + } +} diff --git a/halyard-cli/src/main/java/com/netflix/spinnaker/halyard/cli/command/v1/config/canary/signalfx/account/SignalfxAddCanaryAccountCommand.java b/halyard-cli/src/main/java/com/netflix/spinnaker/halyard/cli/command/v1/config/canary/signalfx/account/SignalfxAddCanaryAccountCommand.java new file mode 100644 index 0000000000..f4d0758be0 --- /dev/null +++ b/halyard-cli/src/main/java/com/netflix/spinnaker/halyard/cli/command/v1/config/canary/signalfx/account/SignalfxAddCanaryAccountCommand.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2018 Nike, 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.signalfx.account; + +import com.beust.jcommander.Parameter; +import com.beust.jcommander.Parameters; +import com.netflix.spinnaker.halyard.cli.command.v1.config.canary.account.AbstractAddCanaryAccountCommand; +import com.netflix.spinnaker.halyard.config.model.v1.canary.AbstractCanaryAccount; +import com.netflix.spinnaker.halyard.config.model.v1.canary.Canary; +import com.netflix.spinnaker.halyard.config.model.v1.canary.signalfx.SignalfxCanaryAccount; + +@Parameters(separators = "=") +public class SignalfxAddCanaryAccountCommand extends AbstractAddCanaryAccountCommand { + + @Override + protected String getServiceIntegration() { + return "Signalfx"; + } + + @Parameter( + names = "--base-url", + required = true, + description = "The base URL to the SignalFx server." + ) + private String baseUrl; + + @Parameter( + names = "--access-token", + required = true, + password = true, + description = "The SignalFx access token." + ) + private String accessToken; + + + @Override + protected AbstractCanaryAccount buildAccount(Canary canary, String accountName) { + SignalfxCanaryAccount account = (SignalfxCanaryAccount)new SignalfxCanaryAccount().setName(accountName); + + account.setEndpoint(new SignalfxCanaryAccount.Endpoint().setBaseUrl(baseUrl)) + .setAccessToken(accessToken); + + return account; + } + + @Override + protected AbstractCanaryAccount emptyAccount() { + return new SignalfxCanaryAccount(); + } +} diff --git a/halyard-cli/src/main/java/com/netflix/spinnaker/halyard/cli/command/v1/config/canary/signalfx/account/SignalfxCanaryAccountCommand.java b/halyard-cli/src/main/java/com/netflix/spinnaker/halyard/cli/command/v1/config/canary/signalfx/account/SignalfxCanaryAccountCommand.java new file mode 100644 index 0000000000..316ccd234b --- /dev/null +++ b/halyard-cli/src/main/java/com/netflix/spinnaker/halyard/cli/command/v1/config/canary/signalfx/account/SignalfxCanaryAccountCommand.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018 Nike, 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.signalfx.account; + +import com.beust.jcommander.Parameters; +import com.netflix.spinnaker.halyard.cli.command.v1.config.canary.account.AbstractCanaryAccountCommand; + +/** + * Interact with the Signalfx service integration + */ +@Parameters(separators = "=") +public class SignalfxCanaryAccountCommand extends AbstractCanaryAccountCommand { + + @Override + protected String getServiceIntegration() { + return "Signalfx"; + } + + public SignalfxCanaryAccountCommand() { + registerSubcommand(new SignalfxAddCanaryAccountCommand()); + registerSubcommand(new SignalfxEditCanaryAccountCommand()); + } +} + diff --git a/halyard-cli/src/main/java/com/netflix/spinnaker/halyard/cli/command/v1/config/canary/signalfx/account/SignalfxEditCanaryAccountCommand.java b/halyard-cli/src/main/java/com/netflix/spinnaker/halyard/cli/command/v1/config/canary/signalfx/account/SignalfxEditCanaryAccountCommand.java new file mode 100644 index 0000000000..cb9601cf99 --- /dev/null +++ b/halyard-cli/src/main/java/com/netflix/spinnaker/halyard/cli/command/v1/config/canary/signalfx/account/SignalfxEditCanaryAccountCommand.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2018 Nike, 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.signalfx.account; + +import com.beust.jcommander.Parameter; +import com.beust.jcommander.Parameters; +import com.netflix.spinnaker.halyard.cli.command.v1.config.canary.account.AbstractEditCanaryAccountCommand; +import com.netflix.spinnaker.halyard.config.model.v1.canary.AbstractCanaryAccount; +import com.netflix.spinnaker.halyard.config.model.v1.canary.signalfx.SignalfxCanaryAccount; + +@Parameters(separators = "=") +public class SignalfxEditCanaryAccountCommand extends AbstractEditCanaryAccountCommand { + + @Override + protected String getServiceIntegration() { + return "Signalfx"; + } + + @Parameter( + names = "--base-url", + description = "The base URL to the SignalFx server." + ) + private String baseUrl; + + @Parameter( + names = "--access-token", + password = true, + description = "The SignalFx access token." + ) + private String accessToken; + + @Override + protected AbstractCanaryAccount editAccount(SignalfxCanaryAccount account) { + account.setEndpoint(isSet(baseUrl) ? new SignalfxCanaryAccount.Endpoint().setBaseUrl(baseUrl) : account.getEndpoint()); + account.setAccessToken(isSet(accessToken) ? accessToken : account.getAccessToken()); + + return account; + } +} diff --git a/halyard-config/src/main/java/com/netflix/spinnaker/halyard/config/model/v1/canary/AbstractCanaryServiceIntegration.java b/halyard-config/src/main/java/com/netflix/spinnaker/halyard/config/model/v1/canary/AbstractCanaryServiceIntegration.java index b23005c5e7..e01da1afb8 100644 --- a/halyard-config/src/main/java/com/netflix/spinnaker/halyard/config/model/v1/canary/AbstractCanaryServiceIntegration.java +++ b/halyard-config/src/main/java/com/netflix/spinnaker/halyard/config/model/v1/canary/AbstractCanaryServiceIntegration.java @@ -22,6 +22,7 @@ import com.netflix.spinnaker.halyard.config.model.v1.canary.datadog.DatadogCanaryServiceIntegration; import com.netflix.spinnaker.halyard.config.model.v1.canary.google.GoogleCanaryServiceIntegration; import com.netflix.spinnaker.halyard.config.model.v1.canary.prometheus.PrometheusCanaryServiceIntegration; +import com.netflix.spinnaker.halyard.config.model.v1.canary.signalfx.SignalfxCanaryServiceIntegration; import com.netflix.spinnaker.halyard.config.model.v1.node.Node; import com.netflix.spinnaker.halyard.config.model.v1.node.NodeIterator; import com.netflix.spinnaker.halyard.config.model.v1.node.NodeIteratorFactory; @@ -38,6 +39,7 @@ @JsonSubTypes({@JsonSubTypes.Type(value = GoogleCanaryServiceIntegration.class, name = GoogleCanaryServiceIntegration.NAME), @JsonSubTypes.Type(value = PrometheusCanaryServiceIntegration.class, name = PrometheusCanaryServiceIntegration.NAME), @JsonSubTypes.Type(value = DatadogCanaryServiceIntegration.class, name = DatadogCanaryServiceIntegration.NAME), + @JsonSubTypes.Type(value = SignalfxCanaryServiceIntegration.class, name = SignalfxCanaryServiceIntegration.NAME), @JsonSubTypes.Type(value = AwsCanaryServiceIntegration.class, name = AwsCanaryServiceIntegration.NAME)}) @Data @EqualsAndHashCode(callSuper = false) diff --git a/halyard-config/src/main/java/com/netflix/spinnaker/halyard/config/model/v1/canary/Canary.java b/halyard-config/src/main/java/com/netflix/spinnaker/halyard/config/model/v1/canary/Canary.java index dd7387ef70..ba0e96faaa 100644 --- a/halyard-config/src/main/java/com/netflix/spinnaker/halyard/config/model/v1/canary/Canary.java +++ b/halyard-config/src/main/java/com/netflix/spinnaker/halyard/config/model/v1/canary/Canary.java @@ -25,6 +25,8 @@ import com.netflix.spinnaker.halyard.config.model.v1.canary.google.GoogleCanaryServiceIntegration; import com.netflix.spinnaker.halyard.config.model.v1.canary.prometheus.PrometheusCanaryAccount; import com.netflix.spinnaker.halyard.config.model.v1.canary.prometheus.PrometheusCanaryServiceIntegration; +import com.netflix.spinnaker.halyard.config.model.v1.canary.signalfx.SignalfxCanaryAccount; +import com.netflix.spinnaker.halyard.config.model.v1.canary.signalfx.SignalfxCanaryServiceIntegration; import com.netflix.spinnaker.halyard.config.model.v1.node.Node; import com.netflix.spinnaker.halyard.config.model.v1.node.NodeIterator; import com.netflix.spinnaker.halyard.config.model.v1.node.NodeIteratorFactory; @@ -44,6 +46,7 @@ public class Canary extends Node implements Cloneable { Lists.newArrayList(new GoogleCanaryServiceIntegration(), new PrometheusCanaryServiceIntegration(), new DatadogCanaryServiceIntegration(), + new SignalfxCanaryServiceIntegration(), new AwsCanaryServiceIntegration()); boolean reduxLoggerEnabled = true; String defaultMetricsAccount; @@ -78,6 +81,8 @@ public static Class translateCanaryAccountType( return PrometheusCanaryAccount.class; case DatadogCanaryServiceIntegration.NAME : return DatadogCanaryAccount.class; + case SignalfxCanaryServiceIntegration.NAME : + return SignalfxCanaryAccount.class; case AwsCanaryServiceIntegration.NAME : return AwsCanaryAccount.class; default: diff --git a/halyard-config/src/main/java/com/netflix/spinnaker/halyard/config/model/v1/canary/signalfx/SignalfxCanaryAccount.java b/halyard-config/src/main/java/com/netflix/spinnaker/halyard/config/model/v1/canary/signalfx/SignalfxCanaryAccount.java new file mode 100644 index 0000000000..ddef44ba97 --- /dev/null +++ b/halyard-config/src/main/java/com/netflix/spinnaker/halyard/config/model/v1/canary/signalfx/SignalfxCanaryAccount.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2018 Nike, 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.config.model.v1.canary.signalfx; + +import com.netflix.spinnaker.halyard.config.model.v1.canary.AbstractCanaryAccount; +import com.netflix.spinnaker.halyard.config.model.v1.canary.AbstractCanaryServiceIntegration; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; +import lombok.extern.slf4j.Slf4j; + +import java.util.Collections; +import java.util.Set; + +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Slf4j +public class SignalfxCanaryAccount extends AbstractCanaryAccount implements Cloneable { + private Endpoint endpoint; + private String accessToken; + private Set supportedTypes = Collections.singleton(AbstractCanaryServiceIntegration.SupportedTypes.METRICS_STORE); + + @Data + public static class Endpoint { + private String baseUrl; + } +} diff --git a/halyard-config/src/main/java/com/netflix/spinnaker/halyard/config/model/v1/canary/signalfx/SignalfxCanaryServiceIntegration.java b/halyard-config/src/main/java/com/netflix/spinnaker/halyard/config/model/v1/canary/signalfx/SignalfxCanaryServiceIntegration.java new file mode 100644 index 0000000000..0f31df1bbf --- /dev/null +++ b/halyard-config/src/main/java/com/netflix/spinnaker/halyard/config/model/v1/canary/signalfx/SignalfxCanaryServiceIntegration.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2018 Nike, 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.config.model.v1.canary.signalfx; + +import com.netflix.spinnaker.halyard.config.model.v1.canary.AbstractCanaryServiceIntegration; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; +import lombok.extern.slf4j.Slf4j; + +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Slf4j +public class SignalfxCanaryServiceIntegration extends AbstractCanaryServiceIntegration implements Cloneable { + public static final String NAME = "signalfx"; + + String name = NAME; +} diff --git a/halyard-deploy/src/main/java/com/netflix/spinnaker/halyard/deploy/spinnaker/v1/profile/KayentaProfileFactory.java b/halyard-deploy/src/main/java/com/netflix/spinnaker/halyard/deploy/spinnaker/v1/profile/KayentaProfileFactory.java index 7983f4cfe6..c2bd656925 100644 --- a/halyard-deploy/src/main/java/com/netflix/spinnaker/halyard/deploy/spinnaker/v1/profile/KayentaProfileFactory.java +++ b/halyard-deploy/src/main/java/com/netflix/spinnaker/halyard/deploy/spinnaker/v1/profile/KayentaProfileFactory.java @@ -26,6 +26,8 @@ import com.netflix.spinnaker.halyard.config.model.v1.canary.google.GoogleCanaryServiceIntegration; import com.netflix.spinnaker.halyard.config.model.v1.canary.prometheus.PrometheusCanaryAccount; import com.netflix.spinnaker.halyard.config.model.v1.canary.prometheus.PrometheusCanaryServiceIntegration; +import com.netflix.spinnaker.halyard.config.model.v1.canary.signalfx.SignalfxCanaryAccount; +import com.netflix.spinnaker.halyard.config.model.v1.canary.signalfx.SignalfxCanaryServiceIntegration; import com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration; import com.netflix.spinnaker.halyard.deploy.spinnaker.v1.SpinnakerArtifact; import com.netflix.spinnaker.halyard.deploy.spinnaker.v1.SpinnakerRuntimeSettings; @@ -79,6 +81,7 @@ static class KayentaConfig { DatadogConfig datadog; AwsConfig aws; S3Config s3; + SignalFxConfig signalfx; KayentaConfig(Canary canary) { for (AbstractCanaryServiceIntegration svc : canary.getServiceIntegrations()) { @@ -97,6 +100,9 @@ static class KayentaConfig { AwsCanaryServiceIntegration awsSvc = (AwsCanaryServiceIntegration)svc; aws = new AwsConfig(awsSvc); s3 = new S3Config(awsSvc); + } else if (svc instanceof SignalfxCanaryServiceIntegration) { + SignalfxCanaryServiceIntegration signalfxSvc = (SignalfxCanaryServiceIntegration)svc; + signalfx = new SignalFxConfig(signalfxSvc); } } } @@ -175,6 +181,17 @@ static class S3Config { enabled = awsSvc.isS3Enabled(); } } + + @Data + static class SignalFxConfig { + private boolean enabled; + List accounts; + + SignalFxConfig(SignalfxCanaryServiceIntegration signalfxSvc) { + enabled = signalfxSvc.isEnabled(); + accounts = signalfxSvc.getAccounts(); + } + } } } } \ No newline at end of file