Skip to content
This repository has been archived by the owner on Dec 31, 2017. It is now read-only.

Docker hosts management #25

Merged
merged 2 commits into from
Sep 25, 2016
Merged

Docker hosts management #25

merged 2 commits into from
Sep 25, 2016

Conversation

kornelrabczak
Copy link
Owner

No description provided.

@kornelrabczak kornelrabczak merged commit 5fd2fd5 into master Sep 25, 2016
@@ -23,6 +23,8 @@
@Size(min = 5, max = 30)
private String name;

private int maxContainers;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'member def modifier' have incorrect indentation level 4, expected level should be 2.

public class DockerHost implements Serializable {
private static final long serialVersionUID = 1L;

private long id;
private final long id;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'member def modifier' have incorrect indentation level 4, expected level should be 2.


@NonNull
private String name;

@NonNull
private String dockerDaemonUrl;

private Instant created = Instant.now();
private final Instant created = Instant.now();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'member def modifier' have incorrect indentation level 4, expected level should be 2.

private Instant created = Instant.now();
private final Instant created = Instant.now();

public DockerHost() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'ctor def modifier' have incorrect indentation level 4, expected level should be 2.

private final Instant created = Instant.now();

public DockerHost() {
id = new Random().nextLong();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'ctor def' child have incorrect indentation level 8, expected level should be 4.


public DockerHost() {
id = new Random().nextLong();
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'ctor def rcurly' have incorrect indentation level 4, expected level should be 2.

import com.github.dockerjava.api.command.StatsCmd;
import com.github.dockerjava.api.model.Container;
import com.github.dockerjava.api.model.Info;

import java.util.Collection;

public interface ContainerFetcher {
Collection<Container> list();
Info getInfo();
Collection<Container> list(DockerClient dockerClient);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'method def modifier' have incorrect indentation level 4, expected level should be 2.

Info getInfo();
Collection<Container> list(DockerClient dockerClient);

Info getInfo(DockerClient dockerClient);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'method def modifier' have incorrect indentation level 4, expected level should be 2.


Info getInfo(DockerClient dockerClient);

DockerClient getDockerClient(final String dockerHost, final String apiVersion);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'method def modifier' have incorrect indentation level 4, expected level should be 2.

DockerClientConfig config = DefaultDockerClientConfig.createDefaultConfigBuilder()
.withDockerHost("tcp:https://0.0.0.0:2376")
.withApiVersion("1.24")
dockerClient = getDockerClient("tcp:https://0.0.0.0:2375", "1.24");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'method def' child have incorrect indentation level 8, expected level should be 4.

.withDockerHost("tcp:https://0.0.0.0:2376")
.withApiVersion("1.24")
dockerClient = getDockerClient("tcp:https://0.0.0.0:2375", "1.24");
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'method def rcurly' have incorrect indentation level 4, expected level should be 2.

dockerClient = getDockerClient("tcp:https://0.0.0.0:2375", "1.24");
}

public DockerClient getDockerClient(final String dockerHost, final String apiVersion) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'method def modifier' have incorrect indentation level 4, expected level should be 2.

dockerClient = getDockerClient("tcp:https://0.0.0.0:2375", "1.24");
}

public DockerClient getDockerClient(final String dockerHost, final String apiVersion) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: Missing a Javadoc comment.

}

public DockerClient getDockerClient(final String dockerHost, final String apiVersion) {
DefaultDockerClientConfig config = DefaultDockerClientConfig.createDefaultConfigBuilder()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'member def type' have incorrect indentation level 8, expected level should be 4.

}

public DockerClient getDockerClient(final String dockerHost, final String apiVersion) {
DefaultDockerClientConfig config = DefaultDockerClientConfig.createDefaultConfigBuilder()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'method def' child have incorrect indentation level 8, expected level should be 4.

.build();
dockerClient = DockerClientBuilder.getInstance(config).build();
return DockerClientBuilder.getInstance(config).build();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'method def' child have incorrect indentation level 8, expected level should be 4.

@@ -71,6 +71,14 @@ public String addHost(@Valid DockerHost dockerHost, @RequestParam long clusterId
return "redirect:/clusters/all";
}

@RequestMapping(value = "clusters/node", method = RequestMethod.DELETE)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'method def modifier' have incorrect indentation level 4, expected level should be 2.

@@ -71,6 +71,14 @@ public String addHost(@Valid DockerHost dockerHost, @RequestParam long clusterId
return "redirect:/clusters/all";
}

@RequestMapping(value = "clusters/node", method = RequestMethod.DELETE)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: Missing a Javadoc comment.

@@ -71,6 +71,14 @@ public String addHost(@Valid DockerHost dockerHost, @RequestParam long clusterId
return "redirect:/clusters/all";
}

@RequestMapping(value = "clusters/node", method = RequestMethod.DELETE)
public String deleteHost(@RequestParam Long clusterId, @RequestParam Long hostId) {
Cluster cluster = clusterRepository.getById(clusterId).get();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'member def type' have incorrect indentation level 8, expected level should be 4.

@@ -71,6 +71,14 @@ public String addHost(@Valid DockerHost dockerHost, @RequestParam long clusterId
return "redirect:/clusters/all";
}

@RequestMapping(value = "clusters/node", method = RequestMethod.DELETE)
public String deleteHost(@RequestParam Long clusterId, @RequestParam Long hostId) {
Cluster cluster = clusterRepository.getById(clusterId).get();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'method def' child have incorrect indentation level 8, expected level should be 4.

@RequestMapping(value = "clusters/node", method = RequestMethod.DELETE)
public String deleteHost(@RequestParam Long clusterId, @RequestParam Long hostId) {
Cluster cluster = clusterRepository.getById(clusterId).get();
cluster.getHosts().removeIf(h -> h.getId() == hostId);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'method def' child have incorrect indentation level 8, expected level should be 4.

public String deleteHost(@RequestParam Long clusterId, @RequestParam Long hostId) {
Cluster cluster = clusterRepository.getById(clusterId).get();
cluster.getHosts().removeIf(h -> h.getId() == hostId);
clusterRepository.save(cluster);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'method def' child have incorrect indentation level 8, expected level should be 4.

Cluster cluster = clusterRepository.getById(clusterId).get();
cluster.getHosts().removeIf(h -> h.getId() == hostId);
clusterRepository.save(cluster);
return "redirect:/clusters/all";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'method def' child have incorrect indentation level 8, expected level should be 4.

cluster.getHosts().removeIf(h -> h.getId() == hostId);
clusterRepository.save(cluster);
return "redirect:/clusters/all";
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'method def rcurly' have incorrect indentation level 4, expected level should be 2.

import org.springframework.web.bind.annotation.RequestParam;

import javax.ws.rs.NotFoundException;
import java.util.Collection;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: Wrong lexicographical order for 'java.util.Collection' import. Should be before 'javax.ws.rs.NotFoundException'.


import javax.ws.rs.NotFoundException;
import java.util.Collection;
import java.util.Optional;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: Wrong lexicographical order for 'java.util.Optional' import. Should be before 'javax.ws.rs.NotFoundException'.

@AllArgsConstructor(onConstructor = @__(@Autowired))
public class NodeController {

ContainerFetcher containerFetcher;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'member def type' have incorrect indentation level 4, expected level should be 2.


ContainerFetcher containerFetcher;

ClusterRepository clusterRepository;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'member def type' have incorrect indentation level 4, expected level should be 2.


ClusterRepository clusterRepository;

@RequestMapping("/clusters/node")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'method def modifier' have incorrect indentation level 4, expected level should be 2.


ClusterRepository clusterRepository;

@RequestMapping("/clusters/node")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: Missing a Javadoc comment.


@RequestMapping("/clusters/node")
public String node(@RequestParam long clusterId, @RequestParam long nodeId, Model model) {
Optional<Cluster> byId = clusterRepository.getById(clusterId);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'member def type' have incorrect indentation level 8, expected level should be 4.


@RequestMapping("/clusters/node")
public String node(@RequestParam long clusterId, @RequestParam long nodeId, Model model) {
Optional<Cluster> byId = clusterRepository.getById(clusterId);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'method def' child have incorrect indentation level 8, expected level should be 4.

@RequestMapping("/clusters/node")
public String node(@RequestParam long clusterId, @RequestParam long nodeId, Model model) {
Optional<Cluster> byId = clusterRepository.getById(clusterId);
if (!byId.isPresent())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'if' construct must use '{}'s.

@RequestMapping("/clusters/node")
public String node(@RequestParam long clusterId, @RequestParam long nodeId, Model model) {
Optional<Cluster> byId = clusterRepository.getById(clusterId);
if (!byId.isPresent())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'if' have incorrect indentation level 8, expected level should be 4.

if (!byId.isPresent())
throw new NotFoundException("CHANGE ME !");

Cluster cluster = byId.get();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'member def type' have incorrect indentation level 8, expected level should be 4.

if (!byId.isPresent())
throw new NotFoundException("CHANGE ME !");

Cluster cluster = byId.get();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] WARNING: 'method def' child have incorrect indentation level 8, expected level should be 4.

@kornelrabczak kornelrabczak deleted the docker_hosts_management branch September 25, 2016 10:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants