summaryrefslogtreecommitdiffstats
path: root/conductor/README.rst
blob: c90eff64c78797e1e4f3c40ac68bdaf21fdf3450 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
=========
Conductor
=========

OF-HAS is the implementation of the ONAP Homing Service. The formal project name in ONAP is *OF-HAS*. The informal name for the project is *Conductor* (inherited from the seed-code), which is interchangeably used through the project.

Given the description of what needs to be deployed (demands) and the placement requirements (constraints), Conductor determines placement candidates that meet all constraints while optimizing the resource usage of the AIC infrastructure. A customer request may be satisfied by deploying new VMs in AIC (AIC inventory) or by using existing service instances with enough remaining capacity (service inventory).

From a canonical standpoint, Conductor is known as a *homing service*, in the same way OpenStack Heat is an orchestration service, or Nova is a compute service.

* License: Licensed under the Apache License, Version 2.0
* `PyPI`_ - package installation
* `Python/Linux Distribution Notes`_
* `Conductor Template Guide`_
* `Example Templates`_
* `Homing API`_
* `Bugs`_ - issue tracking
* `Source`_

.. _PyPI:
.. _Python/Linux Distribution Notes: /doc/distribution/README.md
.. _Conductor Template Guide: /doc/template/README.md
.. _Example Templates: /examples/README.md
.. _Homing API: /doc/api/README.md
.. _Bugs: https://jira.onap.org/projects/OPTFRA/summary
.. _Source: https://gerrit.onap.org/r/optf/has
0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 * ============LICENSE_START=======================================================
 * ONAP
 * ================================================================================
 * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
 * Modifications Copyright (C) 2023 Nordix Foundation.
 * ================================================================================
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============LICENSE_END=========================================================
 */

package org.onap.policy.common.endpoints.http.server.test;

import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.MultivaluedMap;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import lombok.AccessLevel;
import lombok.Setter;
import org.onap.policy.common.endpoints.http.server.YamlMessageBodyHandler;

/**
 * YamlMessageBodyHandler that tracks activities.
 */
public class MyYamlProvider extends YamlMessageBodyHandler {

    @Setter(AccessLevel.PRIVATE)
    private static boolean readSome = false;

    @Setter(AccessLevel.PRIVATE)
    private static boolean wroteSome = false;

    /**
     * Constructs the object and resets the variables to indicate that no activity has
     * occurred yet.
     */
    public MyYamlProvider() {
        super();
    }

    @Override
    public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType,
                    MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException {

        setReadSome(true);
        return super.readFrom(type, genericType, annotations, mediaType, httpHeaders, entityStream);
    }

    @Override
    public void writeTo(Object object, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType,
                    MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException {

        setWroteSome(true);
        super.writeTo(object, type, genericType, annotations, mediaType, httpHeaders, entityStream);
    }

    public static boolean hasReadSome() {
        return readSome;
    }

    public static boolean hasWrittenSome() {
        return wroteSome;
    }

    public static void resetSome() {
        MyYamlProvider.readSome = false;
        MyYamlProvider.wroteSome = false;
    }

}