All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.dockerjava.api.model.Network Maven / Gradle / Ivy

There is a newer version: 3.4.0
Show newest version
package com.github.dockerjava.api.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

@EqualsAndHashCode
@ToString
public class Network extends DockerObject implements Serializable {
    private static final long serialVersionUID = 1L;

    @JsonProperty("Id")
    private String id;

    @JsonProperty("Name")
    private String name;

    @JsonProperty("Scope")
    private String scope;

    @JsonProperty("Driver")
    private String driver;

    @JsonProperty("EnableIPv6")
    private Boolean enableIPv6;

    @JsonProperty("Internal")
    private Boolean internal;

    @JsonProperty("IPAM")
    private Ipam ipam;

    @JsonProperty("Containers")
    private Map containers;

    @JsonProperty("Options")
    private Map options;

    @JsonProperty("Attachable")
    private Boolean attachable;

    @JsonProperty("Labels")
    public Map labels;

    public String getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getScope() {
        return scope;
    }

    public String getDriver() {
        return driver;
    }

    public Boolean getEnableIPv6() {
        return enableIPv6;
    }

    public Boolean getInternal() {
        return internal;
    }

    public Ipam getIpam() {
        return ipam;
    }

    public Map getContainers() {
        return containers;
    }

    public Map getOptions() {
        return options;
    }

    public Boolean isAttachable() {
        return attachable;
    }

    public Map getLabels() {
        return labels;
    }

    @EqualsAndHashCode
    @ToString
    public static class ContainerNetworkConfig extends DockerObject implements Serializable {
        private static final long serialVersionUID = 1L;

        /**
         * @since {@link RemoteApiVersion#VERSION_1_22}
         */
        @JsonProperty("Name")
        private String name;

        @JsonProperty("EndpointID")
        private String endpointId;

        @JsonProperty("MacAddress")
        private String macAddress;

        @JsonProperty("IPv4Address")
        private String ipv4Address;

        @JsonProperty("IPv6Address")
        private String ipv6Address;

        public String getName() {
            return name;
        }

        public String getEndpointId() {
            return endpointId;
        }

        public String getMacAddress() {
            return macAddress;
        }

        public String getIpv4Address() {
            return ipv4Address;
        }

        public String getIpv6Address() {
            return ipv6Address;
        }
    }

    @EqualsAndHashCode
    @ToString
    public static class Ipam extends DockerObject implements Serializable {
        private static final long serialVersionUID = 1L;

        @JsonProperty("Driver")
        private String driver;

        @JsonProperty("Config")
        private List config = new ArrayList<>();

        @JsonProperty("Options")
        private Map options = null;

        public String getDriver() {
            return driver;
        }

        public Map getOptions() {
            return options;
        }

        public List getConfig() {
            return config;
        }

        public Ipam withConfig(List ipamConfigs) {
            config = ipamConfigs;
            return this;
        }

        public Ipam withConfig(Config... ipamConfigs) {
            config = Arrays.asList(ipamConfigs);
            return this;
        }

        public Ipam withDriver(String driver) {
            this.driver = driver;
            return this;
        }

        @EqualsAndHashCode
        @ToString
        public static class Config extends DockerObject implements Serializable {
            private static final long serialVersionUID = 1L;

            @JsonProperty("Subnet")
            private String subnet;

            @JsonProperty("IPRange")
            private String ipRange;

            @JsonProperty("Gateway")
            private String gateway;

            @JsonProperty("NetworkID")
            private String networkID;

            public String getSubnet() {
                return subnet;
            }

            public String getIpRange() {
                return ipRange;
            }

            public String getGateway() {
                return gateway;
            }

            public Config withSubnet(String subnet) {
                this.subnet = subnet;
                return this;
            }

            public Config withIpRange(String ipRange) {
                this.ipRange = ipRange;
                return this;
            }

            public Config withGateway(String gateway) {
                this.gateway = gateway;
                return this;
            }

            public String getNetworkID() {
                return networkID;
            }

            public void setNetworkID(String networkID) {
                this.networkID = networkID;
            }
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy