Search in sources :

Example 26 with V1Service

use of io.kubernetes.client.models.V1Service in project java by kubernetes-client.

the class CoreV1Api method replaceNamespacedServiceWithHttpInfo.

/**
 * replace the specified Service
 * @param name name of the Service (required)
 * @param namespace object name and auth scope, such as for teams and projects (required)
 * @param body  (required)
 * @param pretty If 'true', then the output is pretty printed. (optional)
 * @return ApiResponse<V1Service>
 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
 */
public ApiResponse<V1Service> replaceNamespacedServiceWithHttpInfo(String name, String namespace, V1Service body, String pretty) throws ApiException {
    com.squareup.okhttp.Call call = replaceNamespacedServiceValidateBeforeCall(name, namespace, body, pretty, null, null);
    Type localVarReturnType = new TypeToken<V1Service>() {
    }.getType();
    return apiClient.execute(call, localVarReturnType);
}
Also used : Type(java.lang.reflect.Type) V1Service(io.kubernetes.client.models.V1Service)

Example 27 with V1Service

use of io.kubernetes.client.models.V1Service in project java by kubernetes-client.

the class CoreV1Api method patchNamespacedServiceWithHttpInfo.

/**
 * partially update the specified Service
 * @param name name of the Service (required)
 * @param namespace object name and auth scope, such as for teams and projects (required)
 * @param body  (required)
 * @param pretty If &#39;true&#39;, then the output is pretty printed. (optional)
 * @return ApiResponse&lt;V1Service&gt;
 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
 */
public ApiResponse<V1Service> patchNamespacedServiceWithHttpInfo(String name, String namespace, Object body, String pretty) throws ApiException {
    com.squareup.okhttp.Call call = patchNamespacedServiceValidateBeforeCall(name, namespace, body, pretty, null, null);
    Type localVarReturnType = new TypeToken<V1Service>() {
    }.getType();
    return apiClient.execute(call, localVarReturnType);
}
Also used : Type(java.lang.reflect.Type) V1Service(io.kubernetes.client.models.V1Service)

Example 28 with V1Service

use of io.kubernetes.client.models.V1Service in project java by kubernetes-client.

the class CoreV1ApiTest method replaceNamespacedServiceTest.

/**
 * replace the specified Service
 *
 * @throws ApiException
 *          if the Api call fails
 */
@Test
public void replaceNamespacedServiceTest() throws ApiException {
    String name = null;
    String namespace = null;
    V1Service body = null;
    String pretty = null;
    V1Service response = api.replaceNamespacedService(name, namespace, body, pretty);
// TODO: test validations
}
Also used : V1Service(io.kubernetes.client.models.V1Service) Test(org.junit.Test)

Example 29 with V1Service

use of io.kubernetes.client.models.V1Service in project java by kubernetes-client.

the class CoreV1ApiTest method patchNamespacedServiceStatusTest.

/**
 * partially update status of the specified Service
 *
 * @throws ApiException
 *          if the Api call fails
 */
@Test
public void patchNamespacedServiceStatusTest() throws ApiException {
    String name = null;
    String namespace = null;
    Object body = null;
    String pretty = null;
    V1Service response = api.patchNamespacedServiceStatus(name, namespace, body, pretty);
// TODO: test validations
}
Also used : V1Service(io.kubernetes.client.models.V1Service) Test(org.junit.Test)

Example 30 with V1Service

use of io.kubernetes.client.models.V1Service in project weblogic-kubernetes-operator by oracle.

the class IngressHelperTest method setUp.

@Before
public void setUp() throws ApiException {
    // make sure test bed is clean
    tearDown();
    // Create domain
    Domain domain = new Domain();
    V1ObjectMeta metadata = new V1ObjectMeta();
    metadata.setName("domianIngressHelperTest");
    metadata.setNamespace(namespace);
    domain.setMetadata(metadata);
    DomainSpec spec = new DomainSpec();
    spec.setDomainName("base_domain");
    spec.setDomainUID(domainUID);
    domain.setSpec(spec);
    info = new DomainPresenceInfo(domain);
    // Create scan
    WlsDomainConfig scan = new WlsDomainConfig();
    WlsServerConfig server1Scan = new WlsServerConfig(server1Name, server1Port, server1Name, null);
    WlsServerConfig server2Scan = new WlsServerConfig(server2Name, server2Port, server2Name, null);
    scan.getServerConfigs().put(server1Name, server1Scan);
    scan.getServerConfigs().put(server2Name, server2Scan);
    WlsClusterConfig cluster1Scan = new WlsClusterConfig(clusterName);
    cluster1Scan.getServerConfigs().add(server1Scan);
    cluster1Scan.getServerConfigs().add(server2Scan);
    scan.getClusterConfigs().put(clusterName, cluster1Scan);
    info.setScan(scan);
    ServerKubernetesObjects sko = new ServerKubernetesObjects();
    V1Service service = new V1Service();
    V1ObjectMeta sm = new V1ObjectMeta();
    sm.setName(service1Name);
    sm.setNamespace(namespace);
    service.setMetadata(sm);
    V1ServiceSpec ss = new V1ServiceSpec();
    V1ServicePort port = new V1ServicePort();
    port.setPort(server1Port);
    ss.addPortsItem(port);
    service.setSpec(ss);
    sko.getService().set(service);
    info.getServers().put(server1Name, sko);
    sko = new ServerKubernetesObjects();
    service = new V1Service();
    sm = new V1ObjectMeta();
    sm.setName(service2Name);
    sm.setNamespace(namespace);
    service.setMetadata(sm);
    ss = new V1ServiceSpec();
    port = new V1ServicePort();
    port.setPort(server2Port);
    ss.addPortsItem(port);
    service.setSpec(ss);
    sko.getService().set(service);
    info.getServers().put(server2Name, sko);
    engine = new Engine("IngressHelperTest");
}
Also used : V1ServicePort(io.kubernetes.client.models.V1ServicePort) WlsServerConfig(oracle.kubernetes.operator.wlsconfig.WlsServerConfig) DomainSpec(oracle.kubernetes.weblogic.domain.v1.DomainSpec) V1ObjectMeta(io.kubernetes.client.models.V1ObjectMeta) WlsClusterConfig(oracle.kubernetes.operator.wlsconfig.WlsClusterConfig) V1ServiceSpec(io.kubernetes.client.models.V1ServiceSpec) V1Service(io.kubernetes.client.models.V1Service) Domain(oracle.kubernetes.weblogic.domain.v1.Domain) WlsDomainConfig(oracle.kubernetes.operator.wlsconfig.WlsDomainConfig) Engine(oracle.kubernetes.operator.work.Engine) Before(org.junit.Before)

Aggregations

V1Service (io.kubernetes.client.models.V1Service)34 Test (org.junit.Test)15 Type (java.lang.reflect.Type)14 V1ObjectMeta (io.kubernetes.client.models.V1ObjectMeta)11 ProgressRequestBody (io.kubernetes.client.ProgressRequestBody)7 ProgressResponseBody (io.kubernetes.client.ProgressResponseBody)7 DomainPresenceInfo (oracle.kubernetes.operator.helpers.DomainPresenceInfo)3 V1ServiceList (io.kubernetes.client.models.V1ServiceList)2 V1ServicePort (io.kubernetes.client.models.V1ServicePort)2 V1ServiceSpec (io.kubernetes.client.models.V1ServiceSpec)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 ServerKubernetesObjects (oracle.kubernetes.operator.helpers.ServerKubernetesObjects)2 Engine (oracle.kubernetes.operator.work.Engine)2 Domain (oracle.kubernetes.weblogic.domain.v1.Domain)2 DomainSpec (oracle.kubernetes.weblogic.domain.v1.DomainSpec)2 HttpUserAgentTest (com.meterware.pseudoserver.HttpUserAgentTest)1 ApiException (io.kubernetes.client.ApiException)1 JSON (io.kubernetes.client.JSON)1 IntOrString (io.kubernetes.client.custom.IntOrString)1