Search in sources :

Example 36 with Domain

use of com.microsoft.applicationinsights.smoketest.schemav2.Domain in project weblogic-kubernetes-operator by oracle.

the class WeblogicApi method patchWebLogicOracleV1NamespacedDomainStatusWithHttpInfo.

/**
 * partially update status of the specified Domain
 *
 * @param name
 *          name of the Domain (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<Domain>
 * @throws ApiException
 *           If fail to call the API, e.g. server error or cannot deserialize
 *           the response body
 */
public ApiResponse<Domain> patchWebLogicOracleV1NamespacedDomainStatusWithHttpInfo(String name, String namespace, Patch body, String pretty) throws ApiException {
    com.squareup.okhttp.Call call = patchWebLogicOracleV1NamespacedDomainStatusValidateBeforeCall(name, namespace, body, pretty, null, null);
    Type localVarReturnType = new TypeToken<Domain>() {
    }.getType();
    return apiClient.execute(call, localVarReturnType);
}
Also used : Type(java.lang.reflect.Type) Domain(oracle.kubernetes.weblogic.domain.v1.Domain)

Example 37 with Domain

use of com.microsoft.applicationinsights.smoketest.schemav2.Domain in project weblogic-kubernetes-operator by oracle.

the class RestBackendImpl method getDomainUIDs.

/**
 * {@inheritDoc}
 */
@Override
public Set<String> getDomainUIDs() {
    LOGGER.entering();
    authorize(null, Operation.list);
    Set<String> result = new TreeSet<>();
    List<Domain> domains = getDomainsList();
    for (Domain domain : domains) {
        result.add(domain.getSpec().getDomainUID());
    }
    LOGGER.exiting(result);
    return result;
}
Also used : TreeSet(java.util.TreeSet) Domain(oracle.kubernetes.weblogic.domain.v1.Domain)

Example 38 with Domain

use of com.microsoft.applicationinsights.smoketest.schemav2.Domain in project weblogic-kubernetes-operator by oracle.

the class RestBackendImpl method getDomainsList.

private List<Domain> getDomainsList() {
    CallBuilderFactory factory = ContainerResolver.getInstance().getContainer().getSPI(CallBuilderFactory.class);
    Collection<List<Domain>> c = new ArrayList<List<Domain>>();
    try {
        for (String ns : targetNamespaces) {
            DomainList dl = factory.create().listDomain(ns);
            if (dl != null) {
                c.add(dl.getItems());
            }
        }
        return c.stream().flatMap(Collection::stream).collect(Collectors.toList());
    } catch (ApiException e) {
        throw handleApiException(e);
    }
}
Also used : ArrayList(java.util.ArrayList) CallBuilderFactory(oracle.kubernetes.operator.helpers.CallBuilderFactory) DomainList(oracle.kubernetes.weblogic.domain.v1.DomainList) ArrayList(java.util.ArrayList) List(java.util.List) DomainList(oracle.kubernetes.weblogic.domain.v1.DomainList) Domain(oracle.kubernetes.weblogic.domain.v1.Domain) ApiException(io.kubernetes.client.ApiException)

Example 39 with Domain

use of com.microsoft.applicationinsights.smoketest.schemav2.Domain in project weblogic-kubernetes-operator by oracle.

the class RestBackendImpl method getClusters.

/**
 * {@inheritDoc}
 */
@Override
public Set<String> getClusters(String domainUID) {
    LOGGER.entering(domainUID);
    if (!isDomainUID(domainUID)) {
        throw new AssertionError(formatMessage(MessageKeys.INVALID_DOMAIN_UID, domainUID));
    }
    authorize(domainUID, Operation.get);
    // Get list of WLS Configured Clusters defined for the corresponding WLS Domain identified by Domain UID
    Domain domain = findDomain(domainUID);
    String namespace = getNamespace(domainUID);
    String adminServerServiceName = getAdminServerServiceName(domain);
    String adminSecretName = getAdminServiceSecretName(domain);
    Map<String, WlsClusterConfig> wlsClusterConfigs = getWLSConfiguredClusters(namespace, adminServerServiceName, adminSecretName);
    Set<String> result = wlsClusterConfigs.keySet();
    LOGGER.exiting(result);
    return result;
}
Also used : WlsClusterConfig(oracle.kubernetes.operator.wlsconfig.WlsClusterConfig) Domain(oracle.kubernetes.weblogic.domain.v1.Domain)

Example 40 with Domain

use of com.microsoft.applicationinsights.smoketest.schemav2.Domain in project weblogic-kubernetes-operator by oracle.

the class RestBackendImpl method scaleCluster.

/**
 * {@inheritDoc}
 */
@Override
public void scaleCluster(String domainUID, String cluster, int managedServerCount) {
    LOGGER.entering(domainUID, cluster, managedServerCount);
    if (managedServerCount < 0) {
        throw createWebApplicationException(Status.BAD_REQUEST, MessageKeys.INVALID_MANAGE_SERVER_COUNT, managedServerCount);
    }
    authorize(domainUID, cluster, Operation.update);
    List<Domain> domains = getDomainsList();
    Domain domain = findDomain(domainUID, domains);
    String namespace = getNamespace(domainUID, domains);
    verifyWLSConfiguredClusterCapacity(namespace, domain, cluster, managedServerCount);
    updateReplicasForDomain(namespace, domain, cluster, managedServerCount);
    LOGGER.exiting();
}
Also used : Domain(oracle.kubernetes.weblogic.domain.v1.Domain)

Aggregations

Domain (oracle.kubernetes.weblogic.domain.v1.Domain)33 Type (java.lang.reflect.Type)14 Domain (org.openstack4j.model.identity.v3.Domain)10 ProgressRequestBody (io.kubernetes.client.ProgressRequestBody)7 ProgressResponseBody (io.kubernetes.client.ProgressResponseBody)7 DomainSpec (oracle.kubernetes.weblogic.domain.v1.DomainSpec)7 ArrayList (java.util.ArrayList)6 Test (org.junit.Test)5 V1ObjectMeta (io.kubernetes.client.models.V1ObjectMeta)4 Map (java.util.Map)4 ApiException (io.kubernetes.client.ApiException)3 V1Service (io.kubernetes.client.models.V1Service)3 HashMap (java.util.HashMap)3 CallBuilderFactory (oracle.kubernetes.operator.helpers.CallBuilderFactory)3 Packet (oracle.kubernetes.operator.work.Packet)3 HttpUserAgentTest (com.meterware.pseudoserver.HttpUserAgentTest)2 Data (com.microsoft.applicationinsights.smoketest.schemav2.Data)2 Envelope (com.microsoft.applicationinsights.smoketest.schemav2.Envelope)2 MessageData (com.microsoft.applicationinsights.smoketest.schemav2.MessageData)2 V1ConfigMap (io.kubernetes.client.models.V1ConfigMap)2