Skip to content

Commit

Permalink
feat(md): export artifact from cluster, fix veto (#1173)
Browse files Browse the repository at this point in the history
  • Loading branch information
emjburns committed Apr 29, 2020
1 parent 5cca4d4 commit 2fb7197
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

package com.netflix.spinnaker.gate.model.manageddelivery;

import lombok.Data;

@Data
public class EnvironmentArtifactVeto {
String targetEnvironment;
String reference;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ Resource exportResource(
@Path("name") String name,
@Query("serviceAccount") String serviceAccount);

@GET("/export/artifact/{cloudProvider}/{account}/{clusterName}")
Map<String, Object> exportArtifact(
@Path("cloudProvider") String cloudProvider,
@Path("account") String account,
@Path("clusterName") String clusterName);

@POST("/application/{application}/pin")
Response pin(@Path("application") String application, @Body EnvironmentArtifactPin pin);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,18 @@ ResponseEntity<Resource> exportResource(
return new ResponseEntity<>(resource, yamlResponseHeaders, HttpStatus.OK);
}

@ApiOperation(
value = "Generates an artifact definition based on the artifact used in a running cluster",
response = Map.class)
@GetMapping(path = "/resources/export/artifact/{cloudProvider}/{account}/{clusterName}")
ResponseEntity<Map> exportResource(
@PathVariable("cloudProvider") String cloudProvider,
@PathVariable("account") String account,
@PathVariable("clusterName") String clusterName) {
Map<String, Object> artifact = keelService.exportArtifact(cloudProvider, account, clusterName);
return new ResponseEntity<>(artifact, yamlResponseHeaders, HttpStatus.OK);
}

@ApiOperation(value = "Get a delivery config manifest", response = DeliveryConfig.class)
@GetMapping(path = "/delivery-configs/{name}")
DeliveryConfig getManifest(@PathVariable("name") String name) {
Expand Down

0 comments on commit 2fb7197

Please sign in to comment.