Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/v1.30'
Browse files Browse the repository at this point in the history
  • Loading branch information
ozlerhakan committed Sep 13, 2017
2 parents cbbeaf0 + d9e7ecc commit edc73aa
Show file tree
Hide file tree
Showing 18 changed files with 322 additions and 98 deletions.
2 changes: 1 addition & 1 deletion react/readme.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Rapid front-end
## Rapid Front-end

## Development Mode

Expand Down
2 changes: 1 addition & 1 deletion react/src/components/CommandEditor/docker-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const init = (ace) => {
},
{
token: "variable",
regex: " *(?:GET|POST|DELETE)[ |\t](images|containers|swarm|networks|volumes|_ping|system\\/df|version|info|auth|secrets|nodes|services|tasks|plugins)(?=\\/)?"
regex: " *(?:GET|POST|DELETE)[ |\t](images|containers|swarm|networks|volumes|configs|distribution|_ping|system\\/df|version|info|auth|secrets|nodes|services|tasks|plugins)(?=\\/)?"
},
{
token: "variable",
Expand Down
35 changes: 34 additions & 1 deletion react/src/components/CommandTree/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ export default {
" \"AutoLockManagers\": false,\n" +
" \"ForceNewCluster\": false,\n" +
" \"ListenAddr\": \"192.168.56.101:2377\",\n" +
" \"DataPathAddr\": \"192.168.56.101\",\n" +
" \"Spec\": {\n" +
" \"CAConfig\": {},\n" +
" \"Dispatcher\": {},\n" +
Expand All @@ -363,6 +364,7 @@ export default {
name: 'Join an existing swarm', example: "POST swarm/join\n{\n" +
" \"ListenAddr\": \"0.0.0.0:2377\",\n" +
" \"AdvertiseAddr\": \"192.168.1.1:2377\",\n" +
" \"DataPathAddr\": \"192.168.1.1\",\n" +
" \"RemoteAddrs\": [\n" +
" \"node1:2377\"\n" +
" ],\n" +
Expand Down Expand Up @@ -553,6 +555,31 @@ export default {
{name: 'Inspect a task', example: "GET tasks/id"}
]
},
{
name: 'Configs',
children: [
{name: 'List configs', example: "GET configs?filters={\"name\":{\"my-config-name\":true}}"},
{
name: 'Create a config', example: "POST configs/create\n{\n" +
" \"Name\": \"server.conf\",\n" +
" \"Labels\": {\n" +
" \"foo\": \"bar\"\n" +
" },\n" +
" \"Data\": \"VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==\"\n" +
"}"
},
{
name: 'Update a config', example: "POST configs/id/update?version=15\n{\n" +
" \"Name\": \"server.conf\",\n" +
" \"Labels\": {\n" +
" \"foo\": \"doo\"\n" +
" }\n" +
"}"
},
{name: 'Inspect a config', example: "GET configs/id"},
{name: 'Delete a config', example: "DELETE configs/id"}
]
},
{
name: 'Plugins',
children: [
Expand Down Expand Up @@ -621,6 +648,12 @@ export default {
"]"
}
]
}
},
{
name: 'Distribution',
children: [
{name: 'Get image information from the registry', example: "GET distribution/ozlerhakan/rapid/json"}
]
},
]
};
4 changes: 4 additions & 0 deletions src/main/java/com/kodcu/rapid/app/AppConfig.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.kodcu.rapid.app;

import com.kodcu.rapid.path.Config;
import com.kodcu.rapid.path.Container;
import com.kodcu.rapid.path.Distribution;
import com.kodcu.rapid.path.Image;
import com.kodcu.rapid.path.Network;
import com.kodcu.rapid.path.Node;
Expand Down Expand Up @@ -37,6 +39,8 @@ public Set<Class<?>> getClasses() {
resources.add(Task.class);
resources.add(Plugin.class);
resources.add(Secret.class);
resources.add(Distribution.class);
resources.add(Config.class);
resources.add(JsonProvider.class);
return resources;
}
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/com/kodcu/rapid/config/DockerClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@ public abstract class DockerClient {

private static final String DEFAULT_UNIX_ENDPOINT = "unix:///var/run/docker.sock";
private Client client;
private URI originalUri;
private URI sanitizeUri;

public DockerClient() {
this.init();
}

private void init() {
originalUri = URI.create(DEFAULT_UNIX_ENDPOINT);
final URI originalUri = URI.create(DEFAULT_UNIX_ENDPOINT);
sanitizeUri = UnixFactory.sanitizeUri(originalUri);

final RegistryBuilder<ConnectionSocketFactory> registryBuilder =
Expand All @@ -60,8 +59,7 @@ private void init() {
}

protected WebTarget resource() {
final WebTarget target = client.target(sanitizeUri);
return target;
return client.target(sanitizeUri);
}


Expand Down
34 changes: 19 additions & 15 deletions src/main/java/com/kodcu/rapid/network/UnixSocket.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import java.nio.channels.SocketChannel;
import java.util.Queue;

import static com.kodcu.rapid.util.Constants.UNIMPLEMENTED;

/**
* Created by Hakan on 2/11/2016.
*/
Expand Down Expand Up @@ -51,7 +53,7 @@ public void connect(final SocketAddress endpoint, final int timeout) throws IOEx

@Override
public void bind(final SocketAddress bindpoint) throws IOException {
throw new UnsupportedOperationException("Unimplemented");
throw new UnsupportedOperationException(UNIMPLEMENTED);
}

@Override
Expand Down Expand Up @@ -97,7 +99,7 @@ public SocketAddress getLocalSocketAddress() {

@Override
public SocketChannel getChannel() {
throw new UnsupportedOperationException("Unimplemented");
throw new UnsupportedOperationException(UNIMPLEMENTED);
}

@Override
Expand Down Expand Up @@ -128,6 +130,7 @@ private void setAllSocketOptions() throws SocketException {

@Override
public void setTcpNoDelay(final boolean on) throws SocketException {
// not supported
}

@Override
Expand All @@ -149,17 +152,17 @@ public int getSoLinger() throws SocketException {

@Override
public void sendUrgentData(final int data) throws IOException {
throw new UnsupportedOperationException("Unimplemented");
throw new UnsupportedOperationException(UNIMPLEMENTED);
}

@Override
public void setOOBInline(final boolean on) throws SocketException {
throw new UnsupportedOperationException("Unimplemented");
throw new UnsupportedOperationException(UNIMPLEMENTED);
}

@Override
public boolean getOOBInline() throws SocketException {
throw new UnsupportedOperationException("Unimplemented");
throw new UnsupportedOperationException(UNIMPLEMENTED);
}

@Override
Expand All @@ -179,22 +182,22 @@ public synchronized int getSoTimeout() throws SocketException {

@Override
public synchronized void setSendBufferSize(final int size) throws SocketException {
throw new UnsupportedOperationException("Unimplemented");
throw new UnsupportedOperationException(UNIMPLEMENTED);
}

@Override
public synchronized int getSendBufferSize() throws SocketException {
throw new UnsupportedOperationException("Unimplemented");
throw new UnsupportedOperationException(UNIMPLEMENTED);
}

@Override
public synchronized void setReceiveBufferSize(final int size) throws SocketException {
throw new UnsupportedOperationException("Unimplemented");
throw new UnsupportedOperationException(UNIMPLEMENTED);
}

@Override
public synchronized int getReceiveBufferSize() throws SocketException {
throw new UnsupportedOperationException("Unimplemented");
throw new UnsupportedOperationException(UNIMPLEMENTED);
}

@Override
Expand All @@ -209,12 +212,12 @@ public boolean getKeepAlive() throws SocketException {

@Override
public void setTrafficClass(final int tc) throws SocketException {
throw new UnsupportedOperationException("Unimplemented");
throw new UnsupportedOperationException(UNIMPLEMENTED);
}

@Override
public int getTrafficClass() throws SocketException {
throw new UnsupportedOperationException("Unimplemented");
throw new UnsupportedOperationException(UNIMPLEMENTED);
}

@Override
Expand All @@ -224,7 +227,7 @@ public void setReuseAddress(final boolean on) throws SocketException {

@Override
public boolean getReuseAddress() throws SocketException {
throw new UnsupportedOperationException("Unimplemented");
throw new UnsupportedOperationException(UNIMPLEMENTED);
}

@Override
Expand All @@ -235,6 +238,7 @@ public synchronized void close() throws IOException {
try {
wait(lingerTime * (long) 1000);
} catch (InterruptedException ignored) {
Thread.currentThread().interrupt();
}
sleeping = false;
}
Expand Down Expand Up @@ -279,18 +283,18 @@ public boolean isClosed() {

@Override
public boolean isInputShutdown() {
throw new UnsupportedOperationException("Unimplemented");
throw new UnsupportedOperationException(UNIMPLEMENTED);
}

@Override
public boolean isOutputShutdown() {
throw new UnsupportedOperationException("Unimplemented");
throw new UnsupportedOperationException(UNIMPLEMENTED);
}

@Override
public void setPerformancePreferences(final int connectionTime, final int latency,
final int bandwidth) {
throw new UnsupportedOperationException("Unimplemented");
throw new UnsupportedOperationException(UNIMPLEMENTED);
}

interface SocketOptionSetter {
Expand Down
Loading

0 comments on commit edc73aa

Please sign in to comment.