diff options
Diffstat (limited to 'gui-clamp/ui-react/src/components/dialogs/ControlLoop')
55 files changed, 0 insertions, 10001 deletions
diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/AccordionHeader.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/AccordionHeader.js deleted file mode 100644 index a34b5b3..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/AccordionHeader.js +++ /dev/null @@ -1,120 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - * - * - */ - -import React from "react"; -import styled from "styled-components"; -import { Accordion, Button } from "react-bootstrap"; - -const UninitialisedHeader = styled.div` - margin: 0; - padding: 0 0 1px 0; - border-bottom: 1px solid #7f7f7f; - background: #cccccc; - font-weight: normal; - border-radius: 0; -` - -const PassiveHeader = styled.div` - margin: 0; - padding: 0 0 1px 0; - border-bottom: 1px solid #7f7f7f; - background: #ffe87c; - font-weight: normal; - border-radius: 0; -` - -const RunningHeader = styled.div` - margin: 0; - padding: 0 0 1px 0; - border-bottom: 1px solid #7f7f7f; - background: #7ec699; - font-weight: normal; - border-radius: 0; -` - -const ToggleButton = styled(Button)` - color: #000000; - text-decoration: none; - - :hover, :active { - color: #000000; - text-decoration: none !important; - } -` - -const AccordionHeader = (props) => { - - const index = props.index; - - console.log("----------------"); - console.log(index); - console.log("----------------"); - - const toggleState = () => { - switch (props.orderedState) { - case 'UNINITIALISED': - return renderUninitialisedOrderedState(); - case 'PASSIVE': - return renderPassiveOrderedState(); - case 'RUNNING': - return renderRunningOrderedState(); - default: - return renderUninitialisedOrderedState(); - } - } - - const renderUninitialisedOrderedState = () => { - - return ( - <UninitialisedHeader className="panel-header"> - <Accordion.Toggle as={ToggleButton} variant="link" eventKey={ index.toString() }> - { props.title } - </Accordion.Toggle> - </UninitialisedHeader> - ) - } - - const renderPassiveOrderedState = () => { - return ( - <PassiveHeader className="panel-header"> - <Accordion.Toggle as={ToggleButton} variant="link" eventKey={ index.toString() }> - { props.title } - </Accordion.Toggle> - </PassiveHeader> - ) - } - - const renderRunningOrderedState = () => { - return ( - <RunningHeader className="panel-header"> - <Accordion.Toggle as={ToggleButton} variant="link" eventKey={ index.toString() }> - { props.title } - </Accordion.Toggle> - </RunningHeader> - ) - } - - return ( - toggleState() - ); -} - -export default AccordionHeader;
\ No newline at end of file diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/AccordionHeader.test.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/AccordionHeader.test.js deleted file mode 100644 index 987f1fc..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/AccordionHeader.test.js +++ /dev/null @@ -1,50 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - * - * - */ - -import { shallow } from "enzyme"; -import React from "react"; -import AccordionHeader from "./AccordionHeader"; -import toJson from "enzyme-to-json"; - -describe('Verify AccordionHeader', () => { - - const index = 0; - - it("renders correctly", () => { - const container = shallow(<AccordionHeader index={ index }/>); - expect(toJson(container)).toMatchSnapshot(); - }); - - it("renders correctly when orderState is uninitialized", () => { - const container = shallow(<AccordionHeader title={ "UNINITIALISED_TEST" } orderState={ "UNINITIALISED" } index={ index } key={ index }/>); - expect(toJson(container)).toMatchSnapshot(); - }); - - it("renders correctly when orderState is passive", () => { - const container = shallow(<AccordionHeader title={ "PASSIVE_TEST" } orderState={ "PASSIVE" } index={ index } key={ index }/>); - expect(toJson(container)).toMatchSnapshot(); - }); - - it("renders correctly when orderState is running", () => { - const container = shallow(<AccordionHeader title={ "RUNNING_TEST" } orderState={ "RUNNING" } index={ index } key={ index }/>); - expect(toJson(container)).toMatchSnapshot(); - }); -});
\ No newline at end of file diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/ChangeOrderStateModal.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/ChangeOrderStateModal.js deleted file mode 100644 index 3486ebf..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/ChangeOrderStateModal.js +++ /dev/null @@ -1,171 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -import styled from "styled-components"; -import Modal from "react-bootstrap/Modal"; -import Button from "react-bootstrap/Button"; -import React, { useEffect, useState } from "react"; -import InstantiationOrderStateChangeItem from "./InstantiationOrderStateChangeItem"; -import ControlLoopService from "../../../api/ControlLoopService"; -import { Alert, Container, Dropdown } from "react-bootstrap"; - -const ModalStyled = styled(Modal)` - @media (min-width: 800px) { - .modal-xl { - max-width: 96%; - } - } - background-color: transparent; -` - -const DivWhiteSpaceStyled = styled.div` - overflow: auto; - min-width: 100%; - max-height: 300px; - padding: 5px 5px 0px 5px; - text-align: center; -` - -const AlertStyled = styled(Alert)` - margin-top: 10px; -` - -const ChangeOrderStateModal = (props) => { - const [show, setShow] = useState(true); - const [controlLoopIdentifierList, setControlLoopIdentifierList] = useState([]); - const [orderedState, setOrderedState] = useState(''); - const [toscaOrderStateObject, setToscaOrderStateObject] = useState({}); - const [instantiationOrderStateError, setInstantiationOrderStateError] = useState(false); - const [instantiationOrderStateMsgError, setInstantiationOrderStateMsgError] = useState({}); - const [alertMessage, setAlertMessage] = useState(null); - - useEffect(async () => { - - const instantiationOrderState = await ControlLoopService.getInstanceOrderState( - props.location.instantiationName, - props.location.instantiationVersion) - .catch(error => error.message); - - const orderStateJson = await instantiationOrderState.json(); - - console.log(orderStateJson); - - if (!instantiationOrderState.ok || orderStateJson['controlLoopIdentifierList'].length === 0) { - setInstantiationOrderStateError(true); - setInstantiationOrderStateMsgError(orderStateJson); - } else { - setControlLoopIdentifierList(orderStateJson['controlLoopIdentifierList']); - setOrderedState(orderStateJson['orderedState']); - } - }, []); - - const handleDropSelect = (event) => { - console.log("handleDropDownChange called"); - - const stateChangeObject = { - orderedState: event, - controlLoopIdentifierList: controlLoopIdentifierList - } - setToscaOrderStateObject(stateChangeObject); - setOrderedState(event); - } - - const handleSave = async () => { - console.log("handleSave called"); - - const response = await ControlLoopService.changeInstanceOrderState(toscaOrderStateObject) - .catch(error => error.message); - - if (response.ok) { - successAlert(); - } else { - await errorAlert(response); - } - } - - const handleClose = () => { - console.log('handleClose called'); - setShow(false); - props.history.push('/'); - } - - const successAlert = () => { - console.log("successAlert called"); - setAlertMessage(<Alert variant="success"> - <Alert.Heading>Order State Changed Success</Alert.Heading> - <p>Order State Changed was successfully changed</p> - <hr/> - </Alert>); - } - - const errorAlert = async (response) => { - console.log("errorAlert called"); - setAlertMessage(<Alert variant="danger"> - <Alert.Heading>Order State Changed Failure</Alert.Heading> - <p>An error occurred while trying to change order state</p> - <p>Status code: { await response.status } : { response.statusText }</p> - <p>Status Text: { await response.text() }</p> - <hr/> - </Alert>); - } - - return ( - <ModalStyled size="sm" - show={ show } - onHide={ handleClose } - backdrop="static" - keyboard={ false }> - <Modal.Header closeButton> - <Modal.Title>Manage Instantiation</Modal.Title> - </Modal.Header> - <div style={ { padding: '5px 5px 0 5px' } }> - <Modal.Body> - <Container> - <Dropdown onSelect={ handleDropSelect }> - <Dropdown.Toggle variant="dark" id="dropdown-basic"> - Select Order State - </Dropdown.Toggle> - <Dropdown.Menu> - <Dropdown.Item eventKey="UNINITIALISED">UNINITIALISED</Dropdown.Item> - <Dropdown.Item eventKey="PASSIVE">PASSIVE</Dropdown.Item> - <Dropdown.Item eventKey="RUNNING">RUNNING</Dropdown.Item> - </Dropdown.Menu> - </Dropdown> - { - controlLoopIdentifierList.map((clIdList, index) => ( - <InstantiationOrderStateChangeItem title={ clIdList.name } orderState={ orderedState } index={ index } key={ index }/> - )) - } - </Container> - <AlertStyled show={ instantiationOrderStateError } - variant="danger">Can't get instantiation ordered state:<br/>{ JSON.stringify(instantiationOrderStateMsgError, null, 2) }</AlertStyled> - </Modal.Body> - <DivWhiteSpaceStyled> - { alertMessage } - </DivWhiteSpaceStyled> - </div> - <Modal.Footer> - <Button variant="primary" onClick={ handleSave }>Save</Button> - <Button variant="secondary" onClick={ handleClose }>Close</Button> - </Modal.Footer> - </ModalStyled> - ); -} - -export default ChangeOrderStateModal; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/ChangeOrderStateModal.test.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/ChangeOrderStateModal.test.js deleted file mode 100644 index 63c6a60..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/ChangeOrderStateModal.test.js +++ /dev/null @@ -1,261 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -import React from 'react'; -import { mount, shallow } from 'enzyme'; -import toJson from "enzyme-to-json"; -import ChangeOrderStateModal from "./ChangeOrderStateModal"; -import { createMemoryHistory } from "history"; -import { act } from "react-dom/test-utils"; -import clLoopList from "./testFiles/controlLoopList.json"; -import orderedStateJson from "./testFiles/orderedStateJson.json"; -import ControlLoopService from "../../../api/ControlLoopService"; - -let logSpy = jest.spyOn(console, 'log') -const oldWindowLocation = window.location -describe('Verify ChangeOrderStateModal', () => { - const flushPromises = () => new Promise(setImmediate); - - beforeEach(() => { - logSpy.mockClear() - }) - - afterAll(() => { - window.location = oldWindowLocation - }) - - beforeAll(() => { - jest - .spyOn(global, 'fetch') - .mockImplementation(() => { - return { - ok: true, - status: 200, - text: () => "OK", - json: () => { - return Promise.resolve(orderedStateJson) - } - } - } - ) - - - delete window.location - - // create a new `window.location` object that's *almost* - // like the real thing - window.location = Object.defineProperties( - // start with an empty object on which to define properties - {}, - { - // grab all of the property descriptors for the - // `jsdom` `Location` object - ...Object.getOwnPropertyDescriptors(oldWindowLocation), - instantiationName: { - configurable: true, - value: "PMSH_Instance1", - }, - instantiationVersion: { - configurable: true, - value: "2.3.1", - } - }, - ) - }) - - it("renders without crashing", () => { - act(() => { - shallow(<ChangeOrderStateModal location={window.location}/>); - }) - }); - - it("renders correctly", () => { - act(() => { - const tree = shallow(<ChangeOrderStateModal location={window.location}/>); - expect(toJson(tree)).toMatchSnapshot(); - }) - }); - - it('should have two Button elements', () => { - act(() => { - const container = shallow(<ChangeOrderStateModal location={window.location}/>) - expect(container.find('Button').length).toEqual(2); - }) - }); - - it('should have one dropdown element', () => { - act(() => { - const container = shallow(<ChangeOrderStateModal location={ window.location }/>) - expect(container.find('Dropdown').length).toEqual(1); - }); - }); - - it('handleDropSelect called when dropdown clicked', () => { - const history = createMemoryHistory(); - const component = mount(<ChangeOrderStateModal history={ history } location={window.location}/>) - - act(() => { - component.find('Dropdown').get(0).props.onSelect(); - expect(logSpy).toHaveBeenCalledWith('handleDropDownChange called'); - }); - - component.unmount(); - }); - - it('handleClose called when bottom button clicked', () => { - const history = createMemoryHistory(); - const component = mount(<ChangeOrderStateModal history={ history } location={window.location}/>) - - act(() => { - component.find('[variant="secondary"]').simulate('click'); - expect(logSpy).toHaveBeenCalledWith('handleClose called'); - }); - - component.unmount(); - }); - - it('handleClose called when top-right button clicked', () => { - const history = createMemoryHistory(); - const component = mount(<ChangeOrderStateModal history={ history } location={window.location}/>) - - act(() => { - component.find('[size="sm"]').get(0).props.onHide(); - expect(logSpy).toHaveBeenCalledWith('handleClose called'); - }); - - component.unmount(); - }); - - it('handleSave called when save button clicked and response is ok', async () => { - jest.resetAllMocks() - const getInstanceOrderStateSpy = jest.spyOn(ControlLoopService, 'getInstanceOrderState') - .mockImplementationOnce(() => { - return Promise.resolve({ - ok: true, - status: 200, - text: () => "OK", - json: () => { - return Promise.resolve(orderedStateJson) - } - }) - } - ) - - const changeInstanceOrderStateSpy = jest.spyOn(ControlLoopService, 'changeInstanceOrderState') - .mockImplementationOnce(() => { - return Promise.resolve({ - ok: true, - status: 200, - text: () => "OK", - json: () => { - return Promise.resolve(clLoopList) - } - }) - } - ) - - const component = mount(<ChangeOrderStateModal location={window.location}/>) - - await act( async () => { - component.find('[variant="primary"]').simulate('click'); - await expect(getInstanceOrderStateSpy).toHaveBeenCalled() - await expect(changeInstanceOrderStateSpy).toHaveBeenCalled() - expect(logSpy).toHaveBeenNthCalledWith(1,"handleSave called"); - expect(logSpy).toHaveBeenNthCalledWith(2,"successAlert called"); - }); - }); - - it('handleSave called when save button clicked and response is not ok', async () => { - jest.resetAllMocks() - const getInstanceOrderStateSpy = jest.spyOn(ControlLoopService, 'getInstanceOrderState') - .mockImplementationOnce(() => { - return Promise.resolve({ - ok: true, - status: 200, - text: () => "OK", - json: () => { - return Promise.resolve(orderedStateJson) - } - }) - } - ) - - const changeInstanceOrderStateSpy = jest.spyOn(ControlLoopService, 'changeInstanceOrderState') - .mockImplementationOnce(() => { - return Promise.resolve({ - ok: false, - status: 200, - text: () => "OK", - json: () => { - return Promise.resolve(clLoopList) - } - }) - } - ) - - const component = mount(<ChangeOrderStateModal location={window.location}/>) - - await act( async () => { - component.find('[variant="primary"]').simulate('click'); - await expect(getInstanceOrderStateSpy).toHaveBeenCalled() - await expect(changeInstanceOrderStateSpy).toHaveBeenCalled() - expect(logSpy).toHaveBeenNthCalledWith(1,"handleSave called"); - expect(logSpy).toHaveBeenNthCalledWith(2,"errorAlert called"); - }); - }); - - it('Check useEffect is being called', async () => { - jest.resetAllMocks() - jest.spyOn(ControlLoopService, 'getInstanceOrderState') - .mockImplementationOnce(() => { - return Promise.resolve({ - ok: true, - status: 200, - text: () => "OK", - json: () => { - return Promise.resolve(orderedStateJson) - } - }) - } - ) - - jest.spyOn(ControlLoopService, 'changeInstanceOrderState') - .mockImplementationOnce(() => { - return Promise.resolve({ - ok: true, - status: 200, - text: () => "OK", - json: () => { - return Promise.resolve(clLoopList) - } - }) - } - ) - - const component = mount(<ChangeOrderStateModal location={window.location}/>) - - const useEffect = jest.spyOn(React, "useEffect"); - await act(async () => { - await flushPromises() - component.update() - await expect(useEffect).toHaveBeenCalled(); - }) - component.unmount(); - }); -}); diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/CommissioningModal.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/CommissioningModal.js deleted file mode 100644 index 4f8aaae..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/CommissioningModal.js +++ /dev/null @@ -1,160 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ -import Modal from "react-bootstrap/Modal"; -import Button from "react-bootstrap/Button"; -import React, { useEffect, useState } from "react"; -import styled from "styled-components"; -import ControlLoopService from "../../../api/ControlLoopService"; -import { Alert } from "react-bootstrap"; -import CommissioningUtils from "./utils/CommissioningUtils"; - -const ModalStyled = styled(Modal)` - @media (min-width: 800px) { - .modal-xl { - max-width: 96%; - } - } - background-color: transparent; -` - -const StyledMessagesDiv = styled.div` - overflow: auto; - min-width: 100%; - max-height: 300px; - padding: 5px 5px 0px 5px; - text-align: center; -` - -const AlertStyled = styled(Alert)` - margin-top: 10px; -` - -const CommissioningModal = (props) => { - const [fullToscaTemplate, setFullToscaTemplate] = useState({}); - const [toscaInitialValues, setToscaInitialValues] = useState({}); - const [commonProperties, setCommonProperties] = useState({}) - const [toscaJsonSchema, setToscaJsonSchema] = useState({}); - const [jsonEditor, setJsonEditor] = useState(null); - const [show, setShow] = useState(true); - const [alertMessages, setAlertMessages] = useState(); - const [commonPropertiesResponseOk, setCommonPropertiesResponseOk] = useState(true); - const [serviceTemplateResponseOk, setServiceTemplateResponseOk] = useState(true); - const name = 'ToscaServiceTemplateSimple'; - const version = '1.0.0'; - - useEffect(async () => { - const toscaTemplateResponse = await ControlLoopService.getToscaTemplate(name, version) - .catch(error => error.message); - const toscaCommonProperties = await ControlLoopService.getCommonOrInstanceProperties(name, version, true) - .catch(error => error.message); - - if (!toscaCommonProperties.ok) { - const errorResponse = await toscaCommonProperties.json() - console.log(errorResponse) - setCommonProperties(errorResponse) - setCommonPropertiesResponseOk(false); - } - - if (!toscaTemplateResponse.ok) { - const errorResponse = await toscaTemplateResponse.json() - console.log(errorResponse) - setFullToscaTemplate(errorResponse) - setServiceTemplateResponseOk(false); - } - - if (toscaTemplateResponse.ok && toscaCommonProperties.ok) { - const renderedEditorObjects = CommissioningUtils.renderJsonEditor(toscaTemplateResponse, toscaCommonProperties) - setFullToscaTemplate((await renderedEditorObjects).fullTemplate) - setToscaJsonSchema((await renderedEditorObjects).propertySchema) - setJsonEditor((await renderedEditorObjects).editorTemp) - setToscaInitialValues((await renderedEditorObjects).toscaInitialValues) - - } - - }, []); - - const handleClose = () => { - console.log('handleClose called'); - setShow(false); - props.history.push('/'); - } - - const handleSave = async () => { - console.log("handleSave called") - if (jsonEditor != null) { - setFullToscaTemplate(await CommissioningUtils.updateTemplate(jsonEditor.getValue(), fullToscaTemplate)) - } - } - - - - const handleCommission = async () => { - - console.log("handleCommission called") - - await ControlLoopService.deleteToscaTemplate('ToscaServiceTemplateSimple', "1.0.0") - - const recommissioningResponse = await ControlLoopService.uploadToscaFile(fullToscaTemplate) - - await receiveResponseFromCommissioning(recommissioningResponse) - } - - const receiveResponseFromCommissioning = async (response) => { - console.log("receiveResponseFromCommissioning called") - setAlertMessages(await CommissioningUtils.getAlertMessages(response)); - }; - - return ( - <ModalStyled size="xl" - show={ show } - onHide={ handleClose } - backdrop="static" - keyboard={ false }> - <Modal.Header closeButton> - <Modal.Title>Change Control Loop Common Properties</Modal.Title> - </Modal.Header> - <br/> - <div style={ { padding: '5px 5px 0px 5px' } }> - <Modal.Body> - <div id="editor"/> - <AlertStyled show={ !serviceTemplateResponseOk } - variant="danger">Can't get service template:<br/>{ JSON.stringify(fullToscaTemplate, null, 2) }</AlertStyled> - <AlertStyled show={ !commonPropertiesResponseOk } - variant="danger">Can't get common properties:<br/>{ JSON.stringify(commonProperties, null, 2) }</AlertStyled> - </Modal.Body> - </div> - <StyledMessagesDiv> - { alertMessages } - </StyledMessagesDiv> - <Modal.Footer> - <Button - variant="primary" - onClick={ handleSave } - >Save</Button> - <Button variant="success mr-auto" - onClick={ handleCommission }>Commission</Button> - <Button variant="secondary" - onClick={ handleClose }>Close</Button> - </Modal.Footer> - </ModalStyled> - ); -} - -export default CommissioningModal; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/CommissioningModal.test.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/CommissioningModal.test.js deleted file mode 100644 index 9642145..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/CommissioningModal.test.js +++ /dev/null @@ -1,227 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ -import React from 'react'; -import { mount, shallow } from 'enzyme'; -import toJson from "enzyme-to-json"; -import { act } from "react-dom/test-utils"; -import { createMemoryHistory } from "history"; -import CommissioningModal from "./CommissioningModal"; -import commonProps from "./testFiles/commonProps.json"; -import fullTemp from "./testFiles/fullTemplate.json"; -import ControlLoopService from "../../../api/ControlLoopService"; - -let logSpy = jest.spyOn(console, 'log') -const commonProperties = JSON.parse(JSON.stringify(commonProps)) -const fullTemplate = JSON.parse(JSON.stringify(fullTemp)) -describe('Verify CommissioningModal', () => { - - const unmockedFetch = global.fetch - beforeAll(() => { - global.fetch = () => - Promise.resolve({ - status: 200, - text: () => "OK", - json: () => "{GlobalFetch}" - }) - }) - - afterAll(() => { - global.fetch = unmockedFetch - }) - - beforeEach(() => { - logSpy.mockClear() - }) - - it("renders without crashing", () => { - shallow(<CommissioningModal/>); - }); - - it("renders correctly", () => { - const tree = shallow(<CommissioningModal/>); - expect(toJson(tree)).toMatchSnapshot(); - }); - - it('should have three Button elements', () => { - const container = shallow(<CommissioningModal/>) - expect(container.find('Button').length).toEqual(3); - }); - - it('handleClose called when bottom button clicked', () => { - const history = createMemoryHistory(); - const component = mount(<CommissioningModal history={ history }/>) - - act(() => { - component.find('[variant="secondary"]').simulate('click'); - expect(logSpy).toHaveBeenCalledWith('handleClose called'); - }); - - component.unmount(); - }); - - it('handleClose called when top-right button clicked', () => { - const history = createMemoryHistory(); - const component = mount(<CommissioningModal history={ history }/>) - - act(() => { - component.find('[size="xl"]').get(0).props.onHide(); - expect(logSpy).toHaveBeenCalledWith('handleClose called'); - }); - - component.unmount(); - }); - - it('handleSave called when save button clicked', () => { - const component = shallow(<CommissioningModal/>) - act(() => { - component.find('[variant="primary"]').simulate('click'); - expect(logSpy).toHaveBeenCalledWith("handleSave called"); - }); - }); - - it('getToscaTemplate gets called in useEffect with error', async() => { - const fetchMock = jest.spyOn(ControlLoopService, 'getToscaTemplate').mockImplementation(() => Promise.resolve({ - ok: false, - status: 200, - text: () => "OK", - json: () => fullTemplate - })) - - mount(<CommissioningModal/>) - await act(async () => { - expect(fetchMock).toHaveBeenCalled(); - }); - }); - - it('getCommonProperties gets called in useEffect with error', async() => { - const fetchMock = jest.spyOn(ControlLoopService, 'getToscaTemplate').mockImplementation(() => Promise.resolve({ - ok: false, - status: 200, - text: () => "OK", - json: () => commonProperties - })) - - mount(<CommissioningModal/>) - await act(async () => { - expect(fetchMock).toHaveBeenCalled(); - }); - }); - - it('useState gets called in useEffect with error', async() => { - const useStateSpy = jest.spyOn(React, 'useState') - jest - .spyOn(global, 'fetch') - .mockImplementation(() => - Promise.resolve({ - ok: false, - status: 200, - text: () => "OK", - json: () => "{useState}" - }) - ) - - mount(<CommissioningModal/>) - await act(async () => { - expect(useStateSpy).toHaveBeenCalledTimes(6); - }); - }); - - it('set state gets called for setFullToscaTemplate', () => { - const setFullToscaTemplate = jest.fn(); - const history = createMemoryHistory(); - jest - .spyOn(global, 'fetch') - .mockImplementation(() => - Promise.resolve({ - ok: true, - status: 200, - text: () => "OK", - json: () => fullTemplate - }) - ) - - mount(<CommissioningModal history={ history }/>) - act(async () => { - // expect(renderJsonEditor).toHaveBeenCalled(); - expect(setFullToscaTemplate).toHaveBeenCalledTimes(1); - }); - }); - - it('set state gets called for setToscaJsonSchema useEffect on success', () => { - const setToscaJsonEditor = jest.fn(); - const history = createMemoryHistory(); - jest - .spyOn(global, 'fetch') - .mockImplementation(() => - Promise.resolve({ - ok: true, - status: 200, - text: () => "OK", - json: () => fullTemplate - }) - ) - - mount(<CommissioningModal history={ history }/>) - act(async () => { - expect(setToscaJsonEditor).toHaveBeenCalledTimes(1); - }); - }); - - it('Check useEffect is being called', async () => { - const useEffect = jest.spyOn(React, "useEffect"); - mount(<CommissioningModal/>) - await act(async () => { - expect(useEffect).toHaveBeenCalled(); - }) - }); - - it('test handleCommission called on click', async () => { - const deleteToscaTemplateSpy = jest.spyOn(ControlLoopService, 'deleteToscaTemplate').mockImplementation(() => { - Promise.resolve({ - ok: true, - status: 200, - text: () => "OK", - json: () => "{handleCommissioning}" - }) - }) - const uploadToscaTemplateSpy = jest.spyOn(ControlLoopService, 'uploadToscaFile').mockImplementation(() => { - Promise.resolve({ - ok: true, - status: 200, - text: () => "OK", - json: () => "{uploadToscaFile}" - }) - }) - - - const useStateSpy = jest.spyOn(React, 'useState') - - const component = shallow(<CommissioningModal/>) - component.find('[variant="success mr-auto"]').simulate('click'); - - await act( async () => { - expect(logSpy).toHaveBeenCalledWith("handleCommission called") - expect(await deleteToscaTemplateSpy).toHaveBeenCalled() - expect(await uploadToscaTemplateSpy).toHaveBeenCalled() - expect(logSpy).toHaveBeenCalledWith("receiveResponseFromCommissioning called") - expect(useStateSpy).toHaveBeenCalled() - }) - }) -}); diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/DeleteToscaTemplate.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/DeleteToscaTemplate.js deleted file mode 100644 index c2703cc..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/DeleteToscaTemplate.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -import React, { useState } from "react"; -import Button from "react-bootstrap/Button"; -import ControlLoopService from "../../../api/ControlLoopService"; - -const DeleteToscaTemplate = props => { - - const deleteTemplateHandler = async () => { - console.log('deleteTemplateHandler called'); - - const response = await ControlLoopService.deleteToscaTemplate(props.templateName, props.templateVersion) - .catch(error => error.message); - - if(!response.ok) { - console.log('deleteTemplateHandler called with error'); - } else { - console.log('deleteTemplateHandler called'); - } - // console.log('Response is ok: ' + response.ok); - - props.onDeleteToscaServiceTemplate(response); - - } - - return ( - <React.Fragment> - <Button variant="danger" - type="submit" - style={{float: "right"}} - onClick={ deleteTemplateHandler }>Delete Tosca Service Template</Button> - </React.Fragment> - ); - - -} - -export default DeleteToscaTemplate; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/DeleteToscaTemplate.test.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/DeleteToscaTemplate.test.js deleted file mode 100644 index c52bdea..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/DeleteToscaTemplate.test.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -import React from 'react'; -import { mount, shallow } from 'enzyme'; -import toJson from "enzyme-to-json"; -import DeleteToscaTemplate from "./DeleteToscaTemplate"; - -describe('Verify DeleteToscaTemplate', () => { - - it("renders without crashing", () => { - shallow(<DeleteToscaTemplate/>); - }); - - it("renders correctly", () => { - const tree = shallow(<DeleteToscaTemplate/>); - expect(toJson(tree)).toMatchSnapshot(); - }); - - it('should have a Button element', () => { - const container = shallow(<DeleteToscaTemplate/>) - expect(container.find('Button').length).toEqual(1); - }); - - it('button should call deleteTemplateHandler when clicked', async () => { - const component = mount(<DeleteToscaTemplate/>) - const logSpy = jest.spyOn(console, 'log'); - - component.find('[variant="danger"]').simulate('click'); - expect(logSpy).toHaveBeenCalledWith('deleteTemplateHandler called'); - }); - - it('should have a Button element with specified text', () => { - const container = shallow(<DeleteToscaTemplate/>) - expect(container.find('Button').text()).toBe('Delete Tosca Service Template'); - }); -}); diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/GetLocalToscaFileForUpload.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/GetLocalToscaFileForUpload.js deleted file mode 100644 index 013dd89..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/GetLocalToscaFileForUpload.js +++ /dev/null @@ -1,150 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -import React, { useState } from 'react'; -import Button from "react-bootstrap/Button"; -import Modal from 'react-bootstrap/Modal'; -import Form from 'react-bootstrap/Form'; -import Row from 'react-bootstrap/Row'; -import styled from 'styled-components'; -import Alert from 'react-bootstrap/Alert'; -import * as yaml from "js-yaml"; -import UploadToscaFile from "./UploadToscaFile"; - -const ModalStyled = styled(Modal)` - background-color: transparent; -` - -const StyledMessagesDiv = styled.div` - overflow: auto; - min-width: 100%; - max-height: 300px; - padding: 5px 5px 0px 5px; - text-align: center; -` - -const GetLocalToscaFileForUpload = (props) => { - const [selectedFile, setSelectedFile] = useState(); - const [fileIsSelected, setFileIsSelected] = useState(false); - const [toscaJsonObject, setToscaJsonObject] = useState({}); - const [show, setShow] = useState(true); - const [alertMessages, setAlertMessages] = useState(); - - const handleClose = () => { - console.log('handleClose called'); - setShow(false); - props.history.push('/'); - } - - const fileChangeHandler = (event) => { - event.preventDefault(); - console.log('fileChangeHandler called'); - - if (event.currentTarget.files[0] !== undefined) { - console.log('file defined'); - setSelectedFile(event.currentTarget.files[0]); - setFileIsSelected(true); - - const file = event.currentTarget.files[0]; - - setAlertMessages([]); - - const fileReader = new FileReader(); - - fileReader.onload = () => { - const jsonObj = yaml.load(fileReader.result, 'utf8'); - setToscaJsonObject(jsonObj); - } - - fileReader.readAsText(file); - - } else { - return; - } - }; - - const receiveResponseFromUpload = async (response) => { - - if (await response.ok) { - setAlertMessages(<Alert variant="success"> - <Alert.Heading>Upload Success</Alert.Heading> - <p>Tosca Service Template from { selectedFile.name } was Successfully Uploaded</p> - <hr/> - <p>Type: { selectedFile.type }</p><p>Size: { +selectedFile.size / 1000 }Kb</p> - </Alert>); - } - else { - setAlertMessages(<Alert variant="danger"> - <Alert.Heading>Upload Failure</Alert.Heading> - <p>Tosca Service Template from { selectedFile.name } failed to upload</p> - <p>Status code: { await response.status }: { response.statusText }</p> - <p>Response Text: { await response.text() }</p> - <hr/> - <p>Type: { selectedFile.type }</p><p>Size: { +selectedFile.size / 1000 }Kb</p> - </Alert>); - } - }; - - return ( - <ModalStyled size="lg" - show={ show } - onHide={ handleClose } - backdrop="static" - keyboard={ false }> - <Modal.Header closeButton> - <Modal.Title>Upload Tosca to Commissioning API</Modal.Title> - </Modal.Header> - <br/> - <div style={ { padding: '5px 5px 0px 5px' } }> - <Modal.Body> - <Form style={ { paddingTop: '20px' } }> - <Form.Group as={ Row }> - <Form.File - type="file" - className="custom-file-label" - id="inputGroupFile01" - onChange={ fileChangeHandler } - custom - accept=".yaml,.yml,.json" - label={ fileIsSelected ? selectedFile.name : 'Please select a file' } - > - </Form.File> - <Form.Text>Only .yaml, .yml and .json files are supported</Form.Text> - </Form.Group> - <Form.Group as={ Row }> - <UploadToscaFile toscaObject={ toscaJsonObject } - onResponseReceived={ receiveResponseFromUpload }/> - </Form.Group> - <Form.Group as={ Row }> - <StyledMessagesDiv> - { alertMessages } - </StyledMessagesDiv> - </Form.Group> - </Form> - </Modal.Body> - </div> - <Modal.Footer> - <Button variant="secondary" - onClick={ handleClose }>Close</Button> - </Modal.Footer> - </ModalStyled> - ); -} - -export default GetLocalToscaFileForUpload; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/GetLocalToscaFileForUpload.test.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/GetLocalToscaFileForUpload.test.js deleted file mode 100644 index 9b885c6..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/GetLocalToscaFileForUpload.test.js +++ /dev/null @@ -1,122 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -import React from 'react'; -import { mount, shallow } from 'enzyme'; -import toJson from 'enzyme-to-json'; -import { act } from "react-dom/test-utils"; -import GetLocalToscaFileForUpload from './GetLocalToscaFileForUpload'; -import { createMemoryHistory } from 'history'; - - -describe('Verify GetLocalToscaFileForUpload', () => { - const fs = require('fs'); - let testFile = fs.readFileSync('src/components/dialogs/Policy/toscaData.test.json'); - const file = new Blob([testFile], { type: 'file' }); - - beforeEach(() => { - fetch.resetMocks(); - fetch.mockImplementation(() => { - return Promise.resolve({ - ok: true, - status: 200, - json: () => { - return Promise.resolve({ - "tosca_definitions_version": "tosca_simple_yaml_1_1_0", - "data_types": {}, - "policy_types": {}, - "topology_template": {}, - "name": "ToscaServiceTemplateSimple", - "version": "1.0.0", - "metadata": {}, - "id": "0.19518677404255147" - }); - } - }); - }); - }) - - it("renders without crashing", () => { - shallow(<GetLocalToscaFileForUpload/>); - }); - - it("renders correctly", () => { - const tree = shallow(<GetLocalToscaFileForUpload/>); - expect(toJson(tree)).toMatchSnapshot(); - }); - - it('should have a UploadToscaFile element', () => { - const container = shallow(<GetLocalToscaFileForUpload/>) - expect(container.find('UploadToscaFile').length).toEqual(1); - }); - - it('handleClose called when bottom button clicked', () => { - const history = createMemoryHistory(); - const component = mount(<GetLocalToscaFileForUpload history={ history }/>) - const logSpy = jest.spyOn(console, 'log'); - - - act(() => { - component.find('[variant="secondary"]').simulate('click'); - expect(logSpy).toHaveBeenCalledWith('handleClose called'); - }); - }); - - it('handleClose called when top-right button clicked', () => { - const history = createMemoryHistory(); - const component = mount(<GetLocalToscaFileForUpload history={ history }/>) - const logSpy = jest.spyOn(console, 'log'); - - - act(() => { - component.find('[size="lg"]').get(0).props.onHide(); - expect(logSpy).toHaveBeenCalledWith('handleClose called'); - }); - }); - - it('should call fileChangeHandler on change, file undefined', () => { - const component = mount(<GetLocalToscaFileForUpload/>); - const logSpy = jest.spyOn(console, 'log'); - const event = { - preventDefault() { - }, - currentTarget: { files: [] } - }; - - act(() => { - component.find('[type="file"]').get(0).props.onChange(event); - expect(logSpy).toHaveBeenCalledWith('fileChangeHandler called'); - }); - }); - - it('should call fileChangeHandler on change, file defined', async () => { - const component = mount(<GetLocalToscaFileForUpload/>); - const logSpy = jest.spyOn(console, 'log'); - const event = { - preventDefault() { - }, - currentTarget: { files: [file] } - }; - - act(async () => { - component.find('[type="file"]').get(0).props.onChange(event); - expect(logSpy).toHaveBeenCalledWith('file defined'); - }); - }); -}); diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/GetToscaTemplate.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/GetToscaTemplate.js deleted file mode 100644 index 70c1f41..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/GetToscaTemplate.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -import React, { useState } from "react"; -import Button from "react-bootstrap/Button"; -import ControlLoopService from "../../../api/ControlLoopService"; - -const GetToscaTemplate = (props) => { - - const getTemplateHandler = async () => { - - const response = await ControlLoopService.getToscaTemplate(props.templateName, props.templateVersion) - .catch(error => error.message); - - if(!response.ok) { - console.log('getToscaServiceTemplateHandler called with error') - - } else - { - console.log('getToscaServiceTemplateHandler called') - } - - props.onGetToscaServiceTemplate(response); - - } - - return ( - <React.Fragment> - <Button variant="primary" - type="submit" - onClick={ getTemplateHandler }>Pull Tosca Service Template</Button> - </React.Fragment> - ); - - -} - -export default GetToscaTemplate; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/GetToscaTemplate.test.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/GetToscaTemplate.test.js deleted file mode 100644 index 71fbeec..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/GetToscaTemplate.test.js +++ /dev/null @@ -1,85 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -import React from 'react'; -import { mount, shallow } from 'enzyme'; -import GetToscaTemplate from './GetToscaTemplate'; -import toJson from "enzyme-to-json"; -import { act } from "react-dom/test-utils"; - -describe('Verify GetToscaTemplate', () => { - - const flushPromises = () => new Promise(setImmediate); - - it("renders without crashing", () => { - shallow(<GetToscaTemplate/>); - }); - - it("renders correctly", () => { - const tree = shallow(<GetToscaTemplate/>); - expect(toJson(tree)).toMatchSnapshot(); - }); - - it('should have a Button element', () => { - const container = shallow(<GetToscaTemplate/>) - expect(container.find('Button').length).toEqual(1); - }); - - it('button should call getTemplateHandler when clicked when response is error', async () => { - - const onGetToscaServiceTemplate = jest.fn() - jest - .spyOn(global, 'fetch') - .mockImplementationOnce(async () => - Promise.resolve({ - ok: false, - status: 200, - json: () => { - return Promise.resolve({ - "tosca_definitions_version": "tosca_simple_yaml_1_1_0", - "data_types": {}, - "policy_types": {}, - "topology_template": {}, - "name": "ToscaServiceTemplateSimple", - "version": "1.0.0", - "metadata": {}, - "id": "0.19518677404255147" - }) - } - } - ) - ) - - const component = mount(<GetToscaTemplate onGetToscaServiceTemplate={onGetToscaServiceTemplate}/>) - const logSpy = jest.spyOn(console, 'log'); - - await act(async () => { - component.find('[variant="primary"]').simulate('click'); - await flushPromises() - component.update() - expect(logSpy).toHaveBeenCalledWith('getToscaServiceTemplateHandler called with error'); - }); - component.unmount(); - }); - - it('should have a Button element with specified text', () => { - const container = shallow(<GetToscaTemplate/>) - expect(container.find('Button').text()).toBe('Pull Tosca Service Template'); - }); -}); diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstancePropertiesModal.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstancePropertiesModal.js deleted file mode 100644 index 8c8d403..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstancePropertiesModal.js +++ /dev/null @@ -1,173 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -import React, { useEffect, useState } from "react"; -import Modal from "react-bootstrap/Modal"; -import styled from "styled-components"; -import Button from "react-bootstrap/Button"; -import ControlLoopService from "../../../api/ControlLoopService"; -import Alert from "react-bootstrap/Alert"; -import * as PropTypes from "prop-types"; -import InstantiationUtils from "./utils/InstantiationUtils"; - -const ModalStyled = styled(Modal)` - @media (min-width: 800px) { - .modal-xl { - max-width: 96%; - } - } - background-color: transparent; -` - -const DivWhiteSpaceStyled = styled.div` - overflow: auto; - min-width: 100%; - max-height: 300px; - padding: 5px 5px 0px 5px; - text-align: center; -` - -const AlertStyled = styled(Alert)` - margin-top: 10px; -` - -const templateName = "ToscaServiceTemplateSimple"; -const templateVersion = "1.0.0"; - -function Fragment(props) { - return null; -} - -Fragment.propTypes = { children: PropTypes.node }; -const InstancePropertiesModal = (props) => { - const [show, setShow] = useState(true); - const [toscaFullTemplate, setToscaFullTemplate] = useState({}); - const [jsonEditor, setJsonEditor] = useState(null); - const [alertMessage, setAlertMessage] = useState(null); - const [instancePropertiesGlobal, setInstancePropertiesGlobal] = useState({}); - const [serviceTemplateResponseOk, setServiceTemplateResponseOk] = useState(true); - const [instancePropertiesResponseOk, setInstancePropertiesResponseOk] = useState(true); - const [instanceName, setInstanceName] = useState('') - - useEffect(async () => { - const toscaTemplateResponse = await ControlLoopService.getToscaTemplate(templateName, templateVersion) - .catch(error => error.message); - - const toscaInstanceProperties = await ControlLoopService.getCommonOrInstanceProperties(templateName, templateVersion, false) - .catch(error => error.message); - - if (!toscaInstanceProperties.ok) { - const errorResponse = await toscaInstanceProperties.json(); - console.log(errorResponse); - setInstancePropertiesGlobal(errorResponse); - setInstancePropertiesResponseOk(false); - } - - if (!toscaTemplateResponse.ok) { - const errorResponse = await toscaTemplateResponse.json(); - console.log(errorResponse); - setToscaFullTemplate(errorResponse); - setServiceTemplateResponseOk(false); - } - - if (toscaTemplateResponse.ok && toscaInstanceProperties.ok) { - const renderedJsonSchema = await InstantiationUtils.parseJsonSchema(toscaTemplateResponse, toscaInstanceProperties); - setToscaFullTemplate(await (renderedJsonSchema).fullTemplate); - setJsonEditor(await (renderedJsonSchema).jsonEditor); - } - - }, []); - - const handleClose = () => { - console.log('handleClose called'); - setShow(false); - props.history.push('/'); - } - - const handleSave = async () => { - console.log("handleSave called"); - - setInstanceName(instanceName); - - console.log("instanceName to be saved is: " + instanceName); - - if (jsonEditor != null) { - setToscaFullTemplate(InstantiationUtils.updateTemplate(jsonEditor.getValue(), toscaFullTemplate)); - } - - const response = await ControlLoopService.createInstanceProperties(instanceName, toscaFullTemplate) - .catch(error => error.message); - - if (response.ok) { - successAlert(); - } else { - await errorAlert(response); - } - } - - const successAlert = () => { - console.log("successAlert called"); - setAlertMessage(<Alert variant="success"> - <Alert.Heading>Instantiation Properties Success</Alert.Heading> - <p>Instance Properties was successfully saved</p> - <hr/> - </Alert>); - } - - const errorAlert = async (response) => { - console.log("errorAlert called"); - setAlertMessage(<Alert variant="danger"> - <Alert.Heading>Instantiation Properties Failure</Alert.Heading> - <p>An error occurred while trying to save</p> - <p>Status code: { await response.status } : { response.statusText }</p> - <p>Status Text: { await response.text() }</p> - <hr/> - </Alert>); - } - - return ( - <ModalStyled size="xl" - show={ show } - onHide={ handleClose } - backdrop="static" - keyboard={ false }> - <Modal.Header closeButton> - <Modal.Title>Create Tosca Instance Properties</Modal.Title> - </Modal.Header> - <div style={ { padding: '5px 5px 0 5px' } }> - <Modal.Body> - <div id="editor"/> - <AlertStyled show={ !serviceTemplateResponseOk } - variant="danger">Can't get service template:<br/>{ JSON.stringify(toscaFullTemplate, null, 2) }</AlertStyled> - <AlertStyled show={ !instancePropertiesResponseOk } - variant="danger">Can't get instance properties:<br/>{ JSON.stringify(instancePropertiesGlobal, null, 2) }</AlertStyled> - </Modal.Body> - <DivWhiteSpaceStyled> - { alertMessage } - </DivWhiteSpaceStyled> - </div> - <Modal.Footer> - <Button variant="primary" onClick={ handleSave }>Save</Button> - <Button variant="secondary" onClick={ handleClose }>Close</Button> - </Modal.Footer> - </ModalStyled> - ); -} - -export default InstancePropertiesModal; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstancePropertiesModal.test.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstancePropertiesModal.test.js deleted file mode 100644 index 5c617bf..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstancePropertiesModal.test.js +++ /dev/null @@ -1,103 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -import { mount, shallow } from "enzyme"; -import React from "react"; -import InstancePropertiesModal from "./InstancePropertiesModal"; -import toJson from "enzyme-to-json"; -import { createMemoryHistory } from "history"; -import { act } from "react-dom/test-utils"; - -let logSpy = jest.spyOn(console, 'log') - -describe('Verify InstancePropertiesModal', () => { - - const unmockedFetch = global.fetch - beforeAll(() => { - global.fetch = () => - Promise.resolve({ - status: 200, - text: () => "OK", - json: () => "{GlobalFetch}" - }); - }); - - afterAll(() => { - global.fetch = unmockedFetch - }); - - beforeEach(() => { - logSpy.mockClear() - }); - - it("renders without crashing", () => { - shallow(<InstancePropertiesModal />); - }); - - it("renders correctly", () => { - const tree = shallow(<InstancePropertiesModal />); - expect(toJson(tree)).toMatchSnapshot(); - }); - - it('should have save button element', () => { - const container = shallow(<InstancePropertiesModal/>) - expect(container.find('[variant="primary"]').length).toEqual(1); - }); - - it('should have close button element', () => { - const container = shallow(<InstancePropertiesModal/>) - expect(container.find('[variant="secondary"]').length).toEqual(1); - }); - - it('handleCreateUpdateToscaInstanceProperties called when save button clicked', () => { - const component = mount(<InstancePropertiesModal />) - - act(() => { - component.find('[variant="primary"]').simulate('click'); - expect(logSpy).toHaveBeenCalledWith('handleSave called'); - }); - }); - - it('handleClose called when close button clicked', () => { - const history = createMemoryHistory(); - const component = mount(<InstancePropertiesModal history={ history }/>) - - act(() => { - component.find('[variant="secondary"]').simulate('click'); - expect(logSpy).toHaveBeenCalledWith('handleClose called'); - }); - }); - - it('handleSave called when save button clicked', () => { - const component = mount(<InstancePropertiesModal />) - - act(() => { - component.find('[variant="primary"]').simulate('click'); - expect(logSpy).toHaveBeenCalledWith('handleSave called'); - }); - }); - - it('Check useEffect is being called', async () => { - const useEffect = jest.spyOn(React, "useEffect"); - mount(<InstancePropertiesModal />) - await act(async () => { - expect(useEffect).toHaveBeenCalled(); - }); - }); -}); diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationElementItem.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationElementItem.js deleted file mode 100644 index 0e2c407..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationElementItem.js +++ /dev/null @@ -1,124 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -import React, { useEffect, useState } from "react"; -import styled from "styled-components"; -import { Button } from "react-bootstrap"; - -const UninitialisedBox = styled.div` - margin: 0; - padding: 0 0 1px 0; - border-bottom: 1px solid #7f7f7f; - background: #cccccc; - font-weight: normal; - border-radius: 0; -` -const PassiveBox = styled.div` - margin: 0; - padding: 0 0 1px 0; - border-bottom: 1px solid #7f7f7f; - background: #ffe87c; - font-weight: normal; - border-radius: 0; -` -const RunningBox = styled.div` - margin: 0; - padding: 0 0 1px 0; - border-bottom: 1px solid #7f7f7f; - background: #7ec699; - font-weight: normal; - border-radius: 0; -` -const ButtonStyle = styled(Button)` - margin: 0; - padding: 5px 12px; - width: 100%; - text-align: left; - background: transparent !important; - color: #000000 !important; - text-decoration: none !important; - border: none; - border-radius: 0; - - :hover, :active :focus { - color: #000000 !important; - outline: 0 !important; - box-shadow: none !important; - background: transparent !important; - text-decoration: none !important; - } -` - -const InstantiationElementItem = (props) => { - const [title, setTitle] = useState(""); - - useEffect(() => { - const title = props.title.split("."); - setTitle(title[4]); - }, []); - - const toggleState = () => { - switch (props.orderedState) { - case 'UNINITIALISED': - return renderUninitialisedOrderedState(); - case 'PASSIVE': - return renderPassiveOrderedState(); - case 'RUNNING': - return renderRunningOrderedState(); - } - } - - const renderUninitialisedOrderedState = () => { - return ( - <UninitialisedBox className="panel-header"> - <Button as={ ButtonStyle } variant="link"> - { title } - </Button> - </UninitialisedBox> - ) - } - - const renderPassiveOrderedState = () => { - return ( - <PassiveBox className="panel-header"> - <Button as={ ButtonStyle } variant="link"> - { title } - </Button> - </PassiveBox> - ) - } - - const renderRunningOrderedState = () => { - return ( - <RunningBox className="panel-header"> - <Button as={ ButtonStyle } variant="link" active={ true }> - { title } - </Button> - </RunningBox> - ) - } - - return ( - <React.Fragment> - { toggleState() } - </React.Fragment> - ); -} - -export default InstantiationElementItem; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationElementItem.test.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationElementItem.test.js deleted file mode 100644 index 7b1c1ec..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationElementItem.test.js +++ /dev/null @@ -1,49 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - * - * - */ - -import { shallow } from "enzyme"; -import toJson from "enzyme-to-json"; -import React from "react"; -import InstantiationElementItem from "./InstantiationElementItem"; - -describe('Verify InstantiationElementItem', () => { - const index = 0; - - it("renders correctly", () => { - const container = shallow(<InstantiationElementItem />); - expect(toJson(container)).toMatchSnapshot(); - }); - - it("renders correctly when orderState is uninitialized", () => { - const container = shallow(<InstantiationElementItem title={ "UNINITIALISED_TEST" } orderState={ "UNINITIALISED" } index={ index } key={ index }/>); - expect(toJson(container)).toMatchSnapshot(); - }); - - it("renders correctly when orderState is passive", () => { - const container = shallow(<InstantiationElementItem title={ "PASSIVE_TEST" } orderState={ "PASSIVE" } index={ index } key={ index }/>); - expect(toJson(container)).toMatchSnapshot(); - }); - - it("renders correctly when orderState is running", () => { - const container = shallow(<InstantiationElementItem title={ "RUNNING_TEST" } orderState={ "RUNNING" } index={ index } key={ index }/>); - expect(toJson(container)).toMatchSnapshot(); - }); -});
\ No newline at end of file diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationElements.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationElements.js deleted file mode 100644 index d8e6348..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationElements.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -import React, { useEffect, useState } from "react"; -import InstantiationElementItem from "./InstantiationElementItem"; - -const InstantiationElements = (props) => { - const [clElements, setClElements] = useState([]); - - useEffect(() => { - setClElements(Object.values(props.elements)); - }, []); - - return ( - <React.Fragment> - { - clElements.map((clEl, index) => ( - <InstantiationElementItem title={ clEl["definition"]["name"] } orderedState={ clEl["orderedState"] } key={ index } /> - )) - } - </React.Fragment> - ); -} - -export default InstantiationElements; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationElements.test.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationElements.test.js deleted file mode 100644 index 127a886..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationElements.test.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - * - * - */ - -import toJson from "enzyme-to-json"; -import { shallow } from "enzyme"; -import React from "react"; -import InstantiationElements from "./InstantiationElements"; - -describe('Verify InstantiationElements', () => { - const container = shallow(<InstantiationElements />); - - it("renders correctly", () => { - expect(toJson(container)).toMatchSnapshot(); - }); -});
\ No newline at end of file diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationItem.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationItem.js deleted file mode 100644 index 7b8e453..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationItem.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -import React from "react"; -import styled from 'styled-components'; - -import { Accordion, Button, Card } from "react-bootstrap"; -import AccordionHeader from "./AccordionHeader"; - -const AccordionBody = styled.div` - margin: 0; - padding: 0; - border: 1px solid #7f7f7f; - border-radius: 0; -` - -const CardBody = styled(Card.Body)` - padding: 0; - margin: 0; -` - -const InstantiationItem = (props) => { - - return ( - <Accordion> - <AccordionBody> - <AccordionHeader title={ props.title } orderedState={ props.orderedState } index={ props.index } key={ props.index } /> - <Accordion.Collapse eventKey={ props.index.toString() }> - <CardBody>{ props.children }</CardBody> - </Accordion.Collapse> - </AccordionBody> - </Accordion> - ); -} - -export default InstantiationItem; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationItem.test.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationItem.test.js deleted file mode 100644 index fe4aaf8..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationItem.test.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - * - * - */ - -import React from "react"; -import { shallow } from "enzyme"; -import toJson from "enzyme-to-json"; - -import InstantiationItem from "./InstantiationItem"; - -describe('Verify InstantiationItem', () => { - - const index = 0; - const title = "PMSH Instance"; - const orderState = "UNINITIALISED"; - const container = shallow(<InstantiationItem title={ { title } } orderState={ { orderState } } index={ { index } } key={ { index } }/>); - - it("renders without crashing", () => { - shallow(<InstantiationItem title={ { title } } orderState={ { orderState } } index={ { index } } key={ { index } }/>); - }); - - it("renders correctly", () => { - expect(toJson(container)).toMatchSnapshot(); - }); - - it("should contain an Accordion", () => { - const accordion = container.find('Accordion'); - expect(accordion).toHaveLength(1); - }); - - it("should contain an AccordionHeader", () => { - const accordion = container.find('AccordionHeader'); - expect(accordion).toHaveLength(1); - }); - -});
\ No newline at end of file diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationManagementModal.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationManagementModal.js deleted file mode 100644 index b9db230..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationManagementModal.js +++ /dev/null @@ -1,220 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - * - * - */ - -import Modal from "react-bootstrap/Modal"; -import { Alert, Container, Dropdown, Table } from "react-bootstrap"; -import Button from "react-bootstrap/Button"; -import React, { useEffect, useState } from "react"; -import styled from "styled-components"; -import { Link } from "react-router-dom"; -import ControlLoopService from "../../../api/ControlLoopService"; -import Row from "react-bootstrap/Row"; -import InstantiationUtils from "./utils/InstantiationUtils"; - -const ModalStyled = styled(Modal)` - background-color: transparent; -` - -const HorizontalSpace = styled.div` - padding-right: 2px; - padding-left: 2px; -`; - -const DivWhiteSpaceStyled = styled.div` - overflow: auto; - min-width: 100%; - max-height: 300px; - padding: 5px 5px 0px 5px; - text-align: center; -` -const InstantiationManagementModal = (props) => { - const [show, setShow] = useState(true); - const [instantiationList, setInstantiationList] = useState([]); - const [deleteInstantiation, setDeleteInstantiation] = useState(false); - const [alertMessage, setAlertMessage] = useState(null); - - useEffect(async () => { - - const response = await ControlLoopService.getControlLoopInstantiation(); - - const instantiationListJson = await response.json(); - - const parsedInstantiationList = InstantiationUtils.parseInstantiationList(instantiationListJson['controlLoopList']); - - setInstantiationList(parsedInstantiationList); - }, []); - - const getBackgroundColor = (index) => { - if (index % 2 === 0) { - return 'Silver'; - } - - return 'White'; - } - - const deleteInstantiationHandler = async (index, instantiation) => { - console.log("deleteInstantiationHandler called"); - setDeleteInstantiation(true); - - console.log(instantiation); - - if (instantiation.disableDelete) { - return; - } - - const name = instantiation.name; - const version = instantiation.version; - - const response = await ControlLoopService.deleteInstantiation(name, version); - - updateList(index); - - if (response.ok) { - successAlert(); - setDeleteInstantiation(false); - } else { - await errorAlert(response); - } - } - - const updateList = (index) => { - console.log("updateList called") - - const updatedList = [...instantiationList]; - updatedList.splice(index, 1); - - setInstantiationList(updatedList); - } - - const handleClose = () => { - console.log("handleClose called"); - setShow(false); - props.history.push('/'); - } - - const successAlert = () => { - console.log("successAlert called"); - setAlertMessage(<Alert variant="success"> - <Alert.Heading>Deletion of Instantiation Success</Alert.Heading> - <p>Deletion of Instantiation was successful!</p> - <hr/> - </Alert>); - } - - const errorAlert = async (response) => { - console.log("errorAlert called"); - setAlertMessage(<Alert variant="danger"> - <Alert.Heading>Deletion of Instantiation Failure</Alert.Heading> - <p>An error occurred while trying to delete instantiation</p> - <p>Status code: { await response.status } : { response.statusText }</p> - <p>Status Text: { await response.text() }</p> - <hr/> - </Alert>); - } - - const clearErrors = () => { - console.log("clearErrors called"); - setAlertMessage(null); - } - - return ( - <ModalStyled size="xl" - show={ show } - onHide={ handleClose } - backdrop="static" - keyboard={ false }> - <Modal.Header closeButton> - <Modal.Title>Manage Instances</Modal.Title> - </Modal.Header> - <Modal.Body> - <Container> - <Row> - <Link to={ { pathname: "/editControlLoopInstanceProperties" } }> - <Button variant="primary" type="null">Create Instance</Button> - </Link> - <HorizontalSpace/> - <Link to={ { pathname: "/monitorInstantiation" } }> - <Button variant="secondary" type="null">Monitor Instantiations</Button> - </Link> - </Row> - </Container> - <Table bordered style={ { marginTop: '10px' } }> - <thead> - <tr> - <th>#</th> - <th style={ { textAlign: "center" } }>Instantiation Name</th> - <th style={ { textAlign: "center" } }>Edit Instantiation</th> - <th style={ { textAlign: "center" } }>Delete Instantiation</th> - <th style={ { textAlign: "center" } }>Change Order State</th> - <th style={ { textAlign: "center" } }>Instantiation Order State</th> - <th style={ { textAlign: "center" } }>Instantiation Current State</th> - </tr> - </thead> - <tbody> - { instantiationList.map((instantiation, index) => { - return ( - <tr style={ { backgroundColor: getBackgroundColor(index) } } key={ index } className="instantiationList"> - <td>{ index + 1 }</td> - <td>{ instantiation.name }</td> - <td style={ { textAlign: "center" } }> - <Link to={ { - pathname: "editControlLoopInstanceProperties", - } } state={ instantiation.name }> - <Button variant="outline-success" type="null" - disabled={ true } - style={ { cursor: "not-allowed" } }>Edit</Button> - </Link> - </td> - <td style={ { textAlign: "center" } }> - <Button variant={ instantiation.disabled ? "outline-danger" : "danger" } type="null" - disabled={ instantiation.disableDelete } - style={ instantiation.disableDelete ? { cursor: "not-allowed" } : {} } - onClick={(e) => deleteInstantiationHandler(index, instantiation)}>Delete</Button> - </td> - <td style={ { textAlign: "center" } }> - <Link to={ { - pathname: "changeOrderState", - instantiationName: instantiation.name, - instantiationVersion: instantiation.version - } }> - <Button variant="secondary" type="null">Change</Button> - </Link> - </td> - <td>{ instantiation.orderedState }</td> - <td>{ instantiation.currentState }</td> - </tr> - ) - }) } - </tbody> - </Table> - <DivWhiteSpaceStyled> - { alertMessage } - </DivWhiteSpaceStyled> - </Modal.Body> - <Modal.Footer> - <Button variant="secondary" type="null" onClick={ clearErrors }>Clear Error Message</Button> - <Button variant="secondary" type="null" onClick={ handleClose }>Close</Button> - </Modal.Footer> - </ModalStyled> - ); -} - -export default InstantiationManagementModal; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationManagementModal.test.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationManagementModal.test.js deleted file mode 100644 index d6e33f2..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationManagementModal.test.js +++ /dev/null @@ -1,155 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - * - * - */ - -import {mount, shallow} from "enzyme"; -import React from "react"; -import toJson from "enzyme-to-json"; -import InstantiationManagementModal from "./InstantiationManagementModal"; -import {act} from "react-dom/test-utils"; -import {createMemoryHistory} from "history"; -import ControlLoopService from "../../../api/ControlLoopService"; -import clLoopList from "./testFiles/controlLoopList.json"; -import {BrowserRouter} from "react-router-dom"; - -const logSpy = jest.spyOn(console, 'log') -const history = createMemoryHistory(); - -describe('Verify Instantiation Management', () => { - const flushPromises = () => new Promise(setImmediate); - - beforeEach(() => { - logSpy.mockClear(); - }); - - it("renders without crashing", () => { - shallow(<InstantiationManagementModal/>); - }); - it("renders correctly", () => { - const tree = shallow(<InstantiationManagementModal/>); - expect(toJson(tree)).toMatchSnapshot(); - }); - - it('should have a close Button element', () => { - const container = shallow(<InstantiationManagementModal/>); - const button = container.find('[variant="secondary"]').at(2); - - expect(button.text()).toEqual("Close"); - }); - - it('should have a Create Instance Button element', () => { - const container = shallow(<InstantiationManagementModal/>); - const button = container.find('[variant="primary"]').at(0); - - expect(button.text()).toEqual("Create Instance"); - }); - - it('should have a Monitor Instantiations Button element', () => { - const container = shallow(<InstantiationManagementModal/>); - const button = container.find('[variant="secondary"]').at(0); - - expect(button.text()).toEqual("Monitor Instantiations"); - }); - - it('handleClose called when bottom button clicked', () => { - const container = shallow(<InstantiationManagementModal history={history}/>); - const button = container.find('[variant="secondary"]').at(2); - - act(() => { - button.simulate('click'); - expect(logSpy).toHaveBeenCalledWith('handleClose called'); - }); - }); - - it('handleClose called when top-right button clicked', () => { - const container = shallow(<InstantiationManagementModal history={history}/>); - - act(() => { - container.find('[size="xl"]').get(0).props.onHide(); - expect(logSpy).toHaveBeenCalledWith('handleClose called'); - }); - }); - - it('clearErrors called when clear error message button clicked', () => { - const container = shallow(<InstantiationManagementModal history={history}/>); - const button = container.find('[variant="secondary"]').at(1); - - act(() => { - button.simulate('click'); - expect(logSpy).toHaveBeenCalledWith('clearErrors called'); - }); - }); - - it('Check useEffect is being called', async () => { - jest.resetAllMocks(); - jest.spyOn(ControlLoopService, 'getControlLoopInstantiation') - .mockImplementationOnce(async () => { - return Promise.resolve({ - ok: true, - status: 200, - text: () => "OK", - json: () => { - return Promise.resolve(clLoopList); - } - }); - }); - - const component = mount( - <BrowserRouter> - <InstantiationManagementModal/> - </BrowserRouter> - ); - const useEffect = jest.spyOn(React, "useEffect"); - - await act(async () => { - await flushPromises() - component.update(); - await expect(useEffect).toHaveBeenCalled(); - - }); - component.unmount(); - }); - - it('set state gets called for setInstantiationList useEffect on success', async () => { - const setInstantiationList = jest.fn(); - const setDeleteInstantiation = true; - const history = createMemoryHistory(); - jest - .spyOn(global, 'fetch') - .mockImplementation(() => - Promise.resolve({ - ok: true, - status: 200, - text: () => "OK", - json: () => clLoopList - }) - ) - - mount( - <BrowserRouter> - <InstantiationManagementModal history={history}/> - </BrowserRouter> - ); - act(async () => { - expect(setInstantiationList).toHaveBeenCalledTimes(1); - expect(setDeleteInstantiation).toHaveBeenCalledTimes(1); - }); - }); -}); diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationOrderStateChangeItem.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationOrderStateChangeItem.js deleted file mode 100644 index 8545943..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationOrderStateChangeItem.js +++ /dev/null @@ -1,113 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -import React from "react"; -import styled from "styled-components"; - -const UninitialisedBox = styled.div` - margin: 2px -15px; - padding: 8px; - outline: none; - font-size: 16px; - font-weight: normal; - background: #cccccc; - border-radius: 8px; - border: 1px solid #7f7f7f; - - &:focus, &:active, &:after { - outline: none; - border-radius: 8px; - } -` - -const PassiveBox = styled.div` - margin: 2px -15px; - padding: 8px; - outline: none; - font-size: 16px; - font-weight: normal; - background: #ffe87c; - border-radius: 8px; - border: 1px solid #7f7f7f; - - &:focus, &:active, &:after { - outline: none; - border-radius: 8px; - } -` - -const RunningBox = styled.div` - margin: 2px -15px; - padding: 8px; - outline: none; - font-size: 16px; - font-weight: normal; - background: #7ec699; - border-radius: 8px; - border: 1px solid #7f7f7f; - - &:focus, &:active, &:after { - outline: none; - border-radius: 8px; - } -` - -const InstantiationOrderStateChangeItem = (props) => { - - const renderOrderStateItem = () => { - console.log("renderOrderStateItem called"); - switch (props.orderState) { - case 'UNINITIALISED': - console.log("called UNINITIALISED"); - return renderUninitialisedOrderedState(); - case 'PASSIVE': - console.log("called PASSIVE"); - return renderPassiveOrderedState(); - case 'RUNNING': - console.log("called RUNNING"); - return renderRunningOrderedState(); - } - } - - const renderUninitialisedOrderedState = () => { - return ( - <UninitialisedBox>{ props.title }</UninitialisedBox> - ) - } - - const renderPassiveOrderedState = () => { - return ( - <PassiveBox>{ props.title }</PassiveBox> - ) - } - - const renderRunningOrderedState = () => { - return ( - <RunningBox>{ props.title }</RunningBox> - ) - } - - return ( - <React.Fragment> - { renderOrderStateItem() } - </React.Fragment> - ); -} - -export default InstantiationOrderStateChangeItem; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationOrderStateChangeItem.test.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationOrderStateChangeItem.test.js deleted file mode 100644 index 3981ea5..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationOrderStateChangeItem.test.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -import React from 'react'; -import { mount, shallow } from 'enzyme'; -import toJson from "enzyme-to-json"; -import InstantiationOrderStateChangeItem from "./InstantiationOrderStateChangeItem"; -import CommissioningUtils from "./utils/CommissioningUtils"; - -describe('Verify InstantiationOrderStateChangeItem', () => { - - it("renders without crashing", () => { - shallow(<InstantiationOrderStateChangeItem/>); - }); - - it("renders correctly", () => { - const tree = shallow(<InstantiationOrderStateChangeItem/>); - expect(toJson(tree)).toMatchSnapshot(); - }); - - it("renders correctly when orderState is uninitialized", () => { - const tree = shallow(<InstantiationOrderStateChangeItem orderState="UNINITIALISED" title="UNINITIALISED_TEST"/>); - expect(toJson(tree)).toMatchSnapshot(); - }); - - it("renders correctly when orderState is passive", () => { - const tree = shallow(<InstantiationOrderStateChangeItem orderState="PASSIVE" title="PASSIVE_TEST"/>); - expect(toJson(tree)).toMatchSnapshot(); - }); - - it("renders correctly when orderState is running", () => { - const tree = shallow(<InstantiationOrderStateChangeItem orderState="RUNNING" title="RUNNING_TEST"/>); - expect(toJson(tree)).toMatchSnapshot(); - }); -}); diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/MonitorInstantiation.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/MonitorInstantiation.js deleted file mode 100644 index 4186477..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/MonitorInstantiation.js +++ /dev/null @@ -1,85 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -import React, { useEffect, useState } from "react"; -import styled from "styled-components"; -import Modal from "react-bootstrap/Modal"; -import Button from "react-bootstrap/Button"; -import InstantiationItem from "./InstantiationItem"; -import ControlLoopService from "../../../api/ControlLoopService"; -import InstantiationElements from "./InstantiationElements"; -import { Alert } from "react-bootstrap"; - -const ModalStyled = styled(Modal)` - background-color: transparent; -` -const AlertStyled = styled(Alert)` - margin-top: 10px; -` - -const MonitorInstantiation = (props) => { - const [show, setShow] = useState(true); - const [controlLoopList, setControlLoopList] = useState([]); - const [controlLoopInstantiationOk, setControlLoopInstantiationOk] = useState(true); - const [controlLoopInstantiationError, setControlLoopInstantiationError] = useState({}); - - useEffect(async () => { - const controlLoopInstantiation = await ControlLoopService.getControlLoopInstantiation() - .catch(error => error.message); - - const controlLoopInstantiationJson = await controlLoopInstantiation.json(); - - if (!controlLoopInstantiation.ok || controlLoopInstantiationJson['controlLoopList'].length === 0) { - setControlLoopInstantiationOk(false) - setControlLoopInstantiationError(controlLoopInstantiationJson) - } else { - setControlLoopList(controlLoopInstantiationJson['controlLoopList']); - } - }, []) - - const handleClose = () => { - console.log('handleClose called'); - setShow(false); - props.history.push('/'); - } - - return ( - <ModalStyled size="xl" show={ show } onHide={ handleClose } backdrop="static" keyboard={ false }> - <Modal.Header closeButton> - <Modal.Title>Tosca Instantiation - Monitoring</Modal.Title> - </Modal.Header> - <Modal.Body> - { - controlLoopList.map((clList, index) => ( - <InstantiationItem title={ clList["name"] } orderedState={ clList["orderedState"] } index={ index } key={ index } > - <InstantiationElements elements={ clList["elements"] } /> - </InstantiationItem> - )) - } - <AlertStyled show={ !controlLoopInstantiationOk } - variant="danger">Can't get control loop instantiation info:<br/>{ JSON.stringify(controlLoopInstantiationError, null, 2) }</AlertStyled> - </Modal.Body> - <Modal.Footer> - <Button variant="secondary" type="null" onClick={ handleClose }>Close</Button> - </Modal.Footer> - </ModalStyled> - ) -} - -export default MonitorInstantiation; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/MonitorInstantiation.test.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/MonitorInstantiation.test.js deleted file mode 100644 index 9bc8c04..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/MonitorInstantiation.test.js +++ /dev/null @@ -1,93 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -import React from "react"; -import { mount, shallow } from "enzyme"; -import toJson from "enzyme-to-json"; -import { act } from "react-dom/test-utils"; -import { createMemoryHistory } from "history"; -import MonitorInstantiation from "./MonitorInstantiation"; -import ControlLoopService from "../../../api/ControlLoopService"; -import clLoopList from "./testFiles/controlLoopList.json"; - -const logSpy = jest.spyOn(console, 'log') -const history = createMemoryHistory(); - -describe('Verify MonitorInstantiation', () => { - const flushPromises = () => new Promise(setImmediate); - - beforeEach(() => { - logSpy.mockClear(); - }); - - it("renders correctly", () => { - const container = shallow(<MonitorInstantiation />); - expect(toJson(container)).toMatchSnapshot(); - }); - - it('should have a Button element', () => { - const container = shallow(<MonitorInstantiation />); - expect(container.find('Button').length).toEqual(1); - }); - - it('handleClose called when bottom button clicked', () => { - const container = shallow(<MonitorInstantiation history={ history } />); - const logSpy = jest.spyOn(console, 'log'); - - act(() => { - container.find('[variant="secondary"]').simulate('click'); - expect(logSpy).toHaveBeenCalledWith('handleClose called'); - }); - }); - - it('handleClose called when top-right button clicked', () => { - const container = shallow(<MonitorInstantiation history={ history } />); - const logSpy = jest.spyOn(console, 'log'); - - act(() => { - container.find('[size="xl"]').get(0).props.onHide(); - expect(logSpy).toHaveBeenCalledWith('handleClose called'); - }); - }); - - it('Check useEffect is being called', async () => { - jest.resetAllMocks(); - jest.spyOn(ControlLoopService, 'getControlLoopInstantiation') - .mockImplementationOnce(async () => { - return Promise.resolve({ - ok: true, - status: 200, - text: () => "OK", - json: () => { - return Promise.resolve(clLoopList); - } - }); - }); - - const component = mount(<MonitorInstantiation />); - const useEffect = jest.spyOn(React, "useEffect"); - - await act(async () => { - await flushPromises() - component.update(); - await expect(useEffect).toHaveBeenCalled(); - }); - component.unmount(); - }); -}); diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/ReadAndConvertYaml.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/ReadAndConvertYaml.js deleted file mode 100644 index 5fc97c4..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/ReadAndConvertYaml.js +++ /dev/null @@ -1,132 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -import React, { useState } from "react"; -import GetToscaTemplate from "./GetToscaTemplate"; -import Modal from "react-bootstrap/Modal"; -import Button from "react-bootstrap/Button"; -import { Alert } from "react-bootstrap"; - -import styled from 'styled-components'; -import DeleteToscaTemplate from "./DeleteToscaTemplate"; - -const ModalStyled = styled(Modal)` - background-color: transparent; -` - -const AlertStyled = styled(Alert)` - margin-top: 10px; -` - -const PreStyled = styled.pre` - color: #7F0055; - overflow: auto; - max-height: 70vh; - margin-top: 10px; -` - -const ReadAndConvertYaml = (props) => { - const [show, setShow] = useState(true); - const [toscaTemplateData, setToscaTemplateData] = useState(); - const [deleteToscaTemplateData, setDeleteToscaTemplateData] = useState(null); - const [responseOk, setResponseOk] = useState(true); - const [deleteResponseOk, setDeleteResponseOk] = useState(true); - const [showDeleteButton, setShowDeleteButton] = useState(false); - const name = 'ToscaServiceTemplateSimple'; - const version = '1.0.0'; - - const handleClose = () => { - console.log('handleClose called'); - setShow(false); - props.history.push('/'); - } - - const getToscaServiceTemplateHandler = async (toscaServiceTemplateResponse) => { - - if (!toscaServiceTemplateResponse.ok) { - console.log('Response is not ok'); - setResponseOk(false); - const toscaData = await toscaServiceTemplateResponse.json(); - setToscaTemplateData(toscaData); - } else { - setResponseOk(true); - console.log('Response is ok'); - const toscaData = await toscaServiceTemplateResponse.json(); - setToscaTemplateData(toscaData); - setShowDeleteButton(true) - } - } - - const deleteToscaServiceTemplateHandler = async (deleteToscaServiceTemplateResponse) => { - - if (!deleteToscaServiceTemplateResponse.ok) { - setShowDeleteButton(false) - console.log('Delete response not ok'); - setDeleteResponseOk(false); - const deleteToscaData = await deleteToscaServiceTemplateResponse.json(); - console.log(deleteToscaData) - setDeleteToscaTemplateData(deleteToscaData); - } else { - setShowDeleteButton(false) - setDeleteResponseOk(true); - const deleteToscaData = await deleteToscaServiceTemplateResponse.json(); - setDeleteToscaTemplateData(null) - setDeleteToscaTemplateData(deleteToscaData); - setShowDeleteButton(false); - } - } - - return ( - <ModalStyled size="xl" - show={ show } - onHide={ handleClose } - backdrop="static" - keyboard={ false }> - <Modal.Header closeButton> - <Modal.Title>View Tosca Template</Modal.Title> - </Modal.Header> - <Modal.Body> - <GetToscaTemplate templateName={ name } - templateVersion={ version } - onGetToscaServiceTemplate={ getToscaServiceTemplateHandler }/> - { responseOk && <PreStyled> { JSON.stringify(toscaTemplateData, null, 2) } </PreStyled> } - <AlertStyled show={ !responseOk } - variant="danger">{ JSON.stringify(toscaTemplateData, null, 2) }</AlertStyled> - { showDeleteButton && - <DeleteToscaTemplate templateName={ name } - templateVersion={ version } - onDeleteToscaServiceTemplate={ deleteToscaServiceTemplateHandler } - /> - } - <AlertStyled show={ !deleteResponseOk } - variant="danger">{ JSON.stringify(deleteToscaTemplateData, null, 2) }</AlertStyled> - <AlertStyled show={ deleteResponseOk && deleteToscaTemplateData != null && toscaTemplateData != null} - variant="success"><h2>Delete Successful</h2><PreStyled>{ JSON.stringify(deleteToscaTemplateData, null, 2) }</PreStyled></AlertStyled> - </Modal.Body> - <Modal.Footer> - <Button variant="secondary" - type="null" - onClick={ handleClose }>Close</Button> - </Modal.Footer> - </ModalStyled> - ); -} -; - -export default ReadAndConvertYaml; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/ReadAndConvertYaml.test.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/ReadAndConvertYaml.test.js deleted file mode 100644 index 03192a1..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/ReadAndConvertYaml.test.js +++ /dev/null @@ -1,252 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -import React from 'react'; -import { mount, shallow } from 'enzyme'; -import ReadAndConvertYaml from './ReadAndConvertYaml'; -import GetToscaTemplate from "./GetToscaTemplate"; -import toJson from "enzyme-to-json"; -import { act } from "react-dom/test-utils"; -import { createMemoryHistory } from "history"; - -let logSpy = jest.spyOn(console, 'log') -describe('Verify ReadAndConvertYaml', () => { - - const unmockedFetch = global.fetch - - const flushPromises = () => new Promise(setImmediate); - - beforeAll(() => { - global.fetch = () => - Promise.resolve({ - ok: true, - status: 200, - text: () => "OK", - json: () => Promise.resolve({ - "tosca_definitions_version": "tosca_simple_yaml_1_1_0", - "data_types": {}, - "policy_types": {}, - "topology_template": {}, - "name": "ToscaServiceTemplateSimple", - "version": "1.0.0", - "metadata": {}, - "id": "0.19518677404255147" - }) - }) - }) - - beforeEach(() => { - logSpy.mockClear() - }) - - afterAll(() => { - global.fetch = unmockedFetch - }) - - it("renders without crashing", () => { - shallow(<ReadAndConvertYaml/>); - }); - - it("renders correctly", () => { - const tree = shallow(<ReadAndConvertYaml/>); - expect(toJson(tree)).toMatchSnapshot(); - }); - - it('should have a GetToscaTemplate element', () => { - const container = shallow(<ReadAndConvertYaml/>) - expect(container.find('GetToscaTemplate').length).toEqual(1); - }); - - it('should call getToscaServiceTemplateHandler on click', async () => { - const component = mount(<ReadAndConvertYaml/>); - - await act(async () => { - component.find('GetToscaTemplate').simulate('click'); - await flushPromises() - component.update() - await expect(logSpy).toHaveBeenCalledWith('getToscaServiceTemplateHandler called'); - }); - component.unmount() - }); - - it('should make unsuccessful call getToscaServiceTemplateHandler on click', async () => { - jest - .spyOn(global, 'fetch') - .mockImplementationOnce(async () => - Promise.resolve({ - ok: false, - status: 200, - json: () => { - return Promise.resolve({ - "tosca_definitions_version": "tosca_simple_yaml_1_1_0", - "data_types": {}, - "policy_types": {}, - "topology_template": {}, - "name": "ToscaServiceTemplateSimple", - "version": "1.0.0", - "metadata": {}, - "id": "0.19518677404255147" - }) - } - } - ) - ) - const component = mount(<ReadAndConvertYaml/>); - - await act(async () => { - component.find('GetToscaTemplate').simulate('click'); - await flushPromises() - component.update() - expect(logSpy).toHaveBeenCalledWith('getToscaServiceTemplateHandler called with error'); - }); - component.unmount(); - }); - - it('should make unsuccessful call deleteToscaServiceTemplateHandler on click', async () => { - jest - .spyOn(global, 'fetch') - .mockImplementationOnce(() => - Promise.resolve({ - ok: true, - status: 200, - json: () => { - return Promise.resolve({ - "tosca_definitions_version": "tosca_simple_yaml_1_1_0", - "data_types": {}, - "policy_types": {}, - "topology_template": {}, - "name": "ToscaServiceTemplateSimple", - "version": "1.0.0", - "metadata": {}, - "id": "0.19518677404255147" - }) - } - } - ) - ) - const component = mount(<ReadAndConvertYaml/>); - - await act(async () => { - component.find('GetToscaTemplate').simulate('click'); - await flushPromises() - component.update() - component.find('DeleteToscaTemplate').simulate('click'); - await flushPromises() - component.update() - expect(logSpy).toHaveBeenCalledWith('deleteTemplateHandler called'); - }); - - component.unmount() - }); - - it('should make unsuccessful call deleteToscaServiceTemplateHandler on click', async () => { - const realUseState = React.useState - const stubInitialState = [true] - - const useStateSpy = jest.spyOn(React, 'useState') - useStateSpy.mockImplementationOnce(() => realUseState(stubInitialState)); - - jest - .spyOn(global, 'fetch') - .mockImplementationOnce(() => - Promise.resolve({ - ok: true, - status: 200, - json: () => { - return Promise.resolve({ - "tosca_definitions_version": "tosca_simple_yaml_1_1_0", - "data_types": {}, - "policy_types": {}, - "topology_template": {}, - "name": "ToscaServiceTemplateSimple", - "version": "1.0.0", - "metadata": {}, - "id": "0.19518677404255147" - }) - } - } - ) - ) - const component = mount(<ReadAndConvertYaml/>); - - - await act(async () => { - component.find('GetToscaTemplate').simulate('click'); - await flushPromises() - component.update() - }); - - jest - .spyOn(global, 'fetch') - .mockImplementationOnce(() => - Promise.resolve({ - ok: false, - status: 200, - json: () => { - return Promise.resolve({ - "tosca_definitions_version": "tosca_simple_yaml_1_1_0", - "data_types": {}, - "policy_types": {}, - "topology_template": {}, - "name": "ToscaServiceTemplateSimple", - "version": "1.0.0", - "metadata": {}, - "id": "0.19518677404255147" - }) - } - } - ) - ) - - await act(async () => { - component.find('DeleteToscaTemplate').simulate('click'); - await flushPromises() - component.update() - expect(logSpy).toHaveBeenCalledWith('deleteTemplateHandler called with error'); - }); - component.unmount() - }); - - it('handleClose called when bottom button clicked', () => { - const history = createMemoryHistory(); - const component = mount(<ReadAndConvertYaml history={ history }/>) - - - act(() => { - component.find('[variant="secondary"]').simulate('click'); - expect(logSpy).toHaveBeenCalledWith('handleClose called'); - }); - component.unmount() - }); - - it('handleClose called when top-right button clicked', async () => { - const history = createMemoryHistory(); - const component = mount(<ReadAndConvertYaml history={ history }/>) - const logSpy = jest.spyOn(console, 'log'); - - - await act(async () => { - component.find('[size="xl"]').get(0).props.onHide(); - await flushPromises() - component.update() - expect(logSpy).toHaveBeenCalledWith('handleClose called'); - }); - component.unmount() - }); -}); diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/UploadToscaFile.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/UploadToscaFile.js deleted file mode 100644 index 380838e..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/UploadToscaFile.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -import Button from "react-bootstrap/Button"; -import React, { useState } from "react"; -import ControlLoopService from "../../../api/ControlLoopService"; - -const UploadToscaFile = (props) => { - - const postServiceTemplateHandler = async (event) => { - event.preventDefault(); - console.log('postServiceTemplateHandler called'); - - const response = await ControlLoopService.uploadToscaFile(props.toscaObject) - .catch(error => error.message); - - // const responseMessage = await response.text(); - - props.onResponseReceived(response); - - } - - return ( - <React.Fragment> - <Button variant="primary" - block={ true } - type="submit" - onClick={ postServiceTemplateHandler }> - Upload Tosca Service Template - </Button> - </React.Fragment> - ); - -}; - -export default UploadToscaFile; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/UploadToscaFile.test.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/UploadToscaFile.test.js deleted file mode 100644 index 520eea9..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/UploadToscaFile.test.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -import React from 'react'; -import { mount, shallow } from 'enzyme'; -import UploadToscaFile from './UploadToscaFile'; -import toJson from "enzyme-to-json"; -import { act } from "react-dom/test-utils"; - -describe('Verify UploadToscaFile', () => { - - it("renders without crashing", () => { - shallow(<UploadToscaFile/>); - }); - - it("renders correctly", () => { - const tree = shallow(<UploadToscaFile/>); - expect(toJson(tree)).toMatchSnapshot(); - }); - - it('should have a Button element', () => { - const container = shallow(<UploadToscaFile/>) - expect(container.find('Button').length).toEqual(1); - }); - - it('button should call postServiceTemplateHandler when clicked', async () => { - const component = mount(<UploadToscaFile/>) - const logSpy = jest.spyOn(console, 'log'); - const event = { - preventDefault() { - } - }; - - await act(() => { - component.find('[variant="primary"]').get(0).props.onClick(event); - expect(logSpy).toHaveBeenCalledWith('postServiceTemplateHandler called'); - }) - - }); - - it('should have a Button element with specified text', () => { - const container = shallow(<UploadToscaFile/>) - expect(container.find('Button').text()).toBe('Upload Tosca Service Template'); - }); -}); diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/AccordionHeader.test.js.snap b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/AccordionHeader.test.js.snap deleted file mode 100644 index da86eb7..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/AccordionHeader.test.js.snap +++ /dev/null @@ -1,211 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Verify AccordionHeader renders correctly 1`] = ` -<styled.div - className="panel-header" -> - <ForwardRef - as={ - Object { - "$$typeof": Symbol(react.forward_ref), - "attrs": Array [], - "componentStyle": e { - "baseHash": -417256348, - "baseStyle": undefined, - "componentId": "sc-hKFxyN", - "isStatic": false, - "rules": Array [ - " - color: #000000; - text-decoration: none; - - :hover, :active { - color: #000000; - text-decoration: none !important; - } -", - ], - "staticRulesId": "", - }, - "foldedComponentIds": Array [], - "render": [Function], - "shouldForwardProp": undefined, - "styledComponentId": "sc-hKFxyN", - "target": Object { - "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "active": false, - "disabled": false, - "variant": "primary", - }, - "render": [Function], - }, - "toString": [Function], - "warnTooManyClasses": [Function], - "withComponent": [Function], - } - } - eventKey="0" - variant="link" - /> -</styled.div> -`; - -exports[`Verify AccordionHeader renders correctly when orderState is passive 1`] = ` -<styled.div - className="panel-header" -> - <ForwardRef - as={ - Object { - "$$typeof": Symbol(react.forward_ref), - "attrs": Array [], - "componentStyle": e { - "baseHash": -417256348, - "baseStyle": undefined, - "componentId": "sc-hKFxyN", - "isStatic": false, - "rules": Array [ - " - color: #000000; - text-decoration: none; - - :hover, :active { - color: #000000; - text-decoration: none !important; - } -", - ], - "staticRulesId": "", - }, - "foldedComponentIds": Array [], - "render": [Function], - "shouldForwardProp": undefined, - "styledComponentId": "sc-hKFxyN", - "target": Object { - "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "active": false, - "disabled": false, - "variant": "primary", - }, - "render": [Function], - }, - "toString": [Function], - "warnTooManyClasses": [Function], - "withComponent": [Function], - } - } - eventKey="0" - variant="link" - > - PASSIVE_TEST - </ForwardRef> -</styled.div> -`; - -exports[`Verify AccordionHeader renders correctly when orderState is running 1`] = ` -<styled.div - className="panel-header" -> - <ForwardRef - as={ - Object { - "$$typeof": Symbol(react.forward_ref), - "attrs": Array [], - "componentStyle": e { - "baseHash": -417256348, - "baseStyle": undefined, - "componentId": "sc-hKFxyN", - "isStatic": false, - "rules": Array [ - " - color: #000000; - text-decoration: none; - - :hover, :active { - color: #000000; - text-decoration: none !important; - } -", - ], - "staticRulesId": "", - }, - "foldedComponentIds": Array [], - "render": [Function], - "shouldForwardProp": undefined, - "styledComponentId": "sc-hKFxyN", - "target": Object { - "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "active": false, - "disabled": false, - "variant": "primary", - }, - "render": [Function], - }, - "toString": [Function], - "warnTooManyClasses": [Function], - "withComponent": [Function], - } - } - eventKey="0" - variant="link" - > - RUNNING_TEST - </ForwardRef> -</styled.div> -`; - -exports[`Verify AccordionHeader renders correctly when orderState is uninitialized 1`] = ` -<styled.div - className="panel-header" -> - <ForwardRef - as={ - Object { - "$$typeof": Symbol(react.forward_ref), - "attrs": Array [], - "componentStyle": e { - "baseHash": -417256348, - "baseStyle": undefined, - "componentId": "sc-hKFxyN", - "isStatic": false, - "rules": Array [ - " - color: #000000; - text-decoration: none; - - :hover, :active { - color: #000000; - text-decoration: none !important; - } -", - ], - "staticRulesId": "", - }, - "foldedComponentIds": Array [], - "render": [Function], - "shouldForwardProp": undefined, - "styledComponentId": "sc-hKFxyN", - "target": Object { - "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "active": false, - "disabled": false, - "variant": "primary", - }, - "render": [Function], - }, - "toString": [Function], - "warnTooManyClasses": [Function], - "withComponent": [Function], - } - } - eventKey="0" - variant="link" - > - UNINITIALISED_TEST - </ForwardRef> -</styled.div> -`; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/ChangeOrderStateModal.test.js.snap b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/ChangeOrderStateModal.test.js.snap deleted file mode 100644 index 478b886..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/ChangeOrderStateModal.test.js.snap +++ /dev/null @@ -1,114 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Verify ChangeOrderStateModal renders correctly 1`] = ` -<Styled(Modal) - backdrop="static" - keyboard={false} - onHide={[Function]} - show={true} - size="sm" -> - <ModalHeader - closeButton={true} - closeLabel="Close" - > - <ModalTitle> - Manage Instantiation - </ModalTitle> - </ModalHeader> - <div - style={ - Object { - "padding": "5px 5px 0 5px", - } - } - > - <ModalBody> - <Container - fluid={false} - > - <Dropdown - navbar={false} - onSelect={[Function]} - > - <DropdownToggle - id="dropdown-basic" - variant="dark" - > - Select Order State - </DropdownToggle> - <DropdownMenu - align="left" - alignRight={false} - flip={true} - > - <DropdownItem - as={ - Object { - "$$typeof": Symbol(react.forward_ref), - "render": [Function], - } - } - disabled={false} - eventKey="UNINITIALISED" - > - UNINITIALISED - </DropdownItem> - <DropdownItem - as={ - Object { - "$$typeof": Symbol(react.forward_ref), - "render": [Function], - } - } - disabled={false} - eventKey="PASSIVE" - > - PASSIVE - </DropdownItem> - <DropdownItem - as={ - Object { - "$$typeof": Symbol(react.forward_ref), - "render": [Function], - } - } - disabled={false} - eventKey="RUNNING" - > - RUNNING - </DropdownItem> - </DropdownMenu> - </Dropdown> - </Container> - <Styled(Alert) - show={false} - variant="danger" - > - Can't get instantiation ordered state: - <br /> - {} - </Styled(Alert)> - </ModalBody> - <styled.div /> - </div> - <ModalFooter> - <Button - active={false} - disabled={false} - onClick={[Function]} - variant="primary" - > - Save - </Button> - <Button - active={false} - disabled={false} - onClick={[Function]} - variant="secondary" - > - Close - </Button> - </ModalFooter> -</Styled(Modal)> -`; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/CommissioningModal.test.js.snap b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/CommissioningModal.test.js.snap deleted file mode 100644 index 5ed3f3e..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/CommissioningModal.test.js.snap +++ /dev/null @@ -1,77 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Verify CommissioningModal renders correctly 1`] = ` -<Styled(Modal) - backdrop="static" - keyboard={false} - onHide={[Function]} - show={true} - size="xl" -> - <ModalHeader - closeButton={true} - closeLabel="Close" - > - <ModalTitle> - Change Control Loop Common Properties - </ModalTitle> - </ModalHeader> - <br /> - <div - style={ - Object { - "padding": "5px 5px 0px 5px", - } - } - > - <ModalBody> - <div - id="editor" - /> - <Styled(Alert) - show={false} - variant="danger" - > - Can't get service template: - <br /> - {} - </Styled(Alert)> - <Styled(Alert) - show={false} - variant="danger" - > - Can't get common properties: - <br /> - {} - </Styled(Alert)> - </ModalBody> - </div> - <styled.div /> - <ModalFooter> - <Button - active={false} - disabled={false} - onClick={[Function]} - variant="primary" - > - Save - </Button> - <Button - active={false} - disabled={false} - onClick={[Function]} - variant="success mr-auto" - > - Commission - </Button> - <Button - active={false} - disabled={false} - onClick={[Function]} - variant="secondary" - > - Close - </Button> - </ModalFooter> -</Styled(Modal)> -`; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/DeleteToscaTemplate.test.js.snap b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/DeleteToscaTemplate.test.js.snap deleted file mode 100644 index cd2288e..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/DeleteToscaTemplate.test.js.snap +++ /dev/null @@ -1,20 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Verify DeleteToscaTemplate renders correctly 1`] = ` -<Fragment> - <Button - active={false} - disabled={false} - onClick={[Function]} - style={ - Object { - "float": "right", - } - } - type="submit" - variant="danger" - > - Delete Tosca Service Template - </Button> -</Fragment> -`; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/GetLocalToscaFileForUpload.test.js.snap b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/GetLocalToscaFileForUpload.test.js.snap deleted file mode 100644 index 84168fd..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/GetLocalToscaFileForUpload.test.js.snap +++ /dev/null @@ -1,103 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Verify GetLocalToscaFileForUpload renders correctly 1`] = ` -<Styled(Modal) - backdrop="static" - keyboard={false} - onHide={[Function]} - show={true} - size="lg" -> - <ModalHeader - closeButton={true} - closeLabel="Close" - > - <ModalTitle> - Upload Tosca to Commissioning API - </ModalTitle> - </ModalHeader> - <br /> - <div - style={ - Object { - "padding": "5px 5px 0px 5px", - } - } - > - <ModalBody> - <Form - inline={false} - style={ - Object { - "paddingTop": "20px", - } - } - > - <FormGroup - as={ - Object { - "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "noGutters": false, - }, - "render": [Function], - } - } - > - <FormFile - accept=".yaml,.yml,.json" - className="custom-file-label" - custom={true} - id="inputGroupFile01" - label="Please select a file" - onChange={[Function]} - type="file" - /> - <FormText> - Only .yaml, .yml and .json files are supported - </FormText> - </FormGroup> - <FormGroup - as={ - Object { - "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "noGutters": false, - }, - "render": [Function], - } - } - > - <UploadToscaFile - onResponseReceived={[Function]} - toscaObject={Object {}} - /> - </FormGroup> - <FormGroup - as={ - Object { - "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "noGutters": false, - }, - "render": [Function], - } - } - > - <styled.div /> - </FormGroup> - </Form> - </ModalBody> - </div> - <ModalFooter> - <Button - active={false} - disabled={false} - onClick={[Function]} - variant="secondary" - > - Close - </Button> - </ModalFooter> -</Styled(Modal)> -`; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/GetToscaTemplate.test.js.snap b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/GetToscaTemplate.test.js.snap deleted file mode 100644 index 873afa7..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/GetToscaTemplate.test.js.snap +++ /dev/null @@ -1,15 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Verify GetToscaTemplate renders correctly 1`] = ` -<Fragment> - <Button - active={false} - disabled={false} - onClick={[Function]} - type="submit" - variant="primary" - > - Pull Tosca Service Template - </Button> -</Fragment> -`; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/InstancePropertiesModal.test.js.snap b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/InstancePropertiesModal.test.js.snap deleted file mode 100644 index d655b08..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/InstancePropertiesModal.test.js.snap +++ /dev/null @@ -1,68 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Verify InstancePropertiesModal renders correctly 1`] = ` -<Styled(Modal) - backdrop="static" - keyboard={false} - onHide={[Function]} - show={true} - size="xl" -> - <ModalHeader - closeButton={true} - closeLabel="Close" - > - <ModalTitle> - Create Tosca Instance Properties - </ModalTitle> - </ModalHeader> - <div - style={ - Object { - "padding": "5px 5px 0 5px", - } - } - > - <ModalBody> - <div - id="editor" - /> - <Styled(Alert) - show={false} - variant="danger" - > - Can't get service template: - <br /> - {} - </Styled(Alert)> - <Styled(Alert) - show={false} - variant="danger" - > - Can't get instance properties: - <br /> - {} - </Styled(Alert)> - </ModalBody> - <styled.div /> - </div> - <ModalFooter> - <Button - active={false} - disabled={false} - onClick={[Function]} - variant="primary" - > - Save - </Button> - <Button - active={false} - disabled={false} - onClick={[Function]} - variant="secondary" - > - Close - </Button> - </ModalFooter> -</Styled(Modal)> -`; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/InstantiationElementItem.test.js.snap b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/InstantiationElementItem.test.js.snap deleted file mode 100644 index 81f5f26..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/InstantiationElementItem.test.js.snap +++ /dev/null @@ -1,9 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Verify InstantiationElementItem renders correctly 1`] = `<Fragment />`; - -exports[`Verify InstantiationElementItem renders correctly when orderState is passive 1`] = `<Fragment />`; - -exports[`Verify InstantiationElementItem renders correctly when orderState is running 1`] = `<Fragment />`; - -exports[`Verify InstantiationElementItem renders correctly when orderState is uninitialized 1`] = `<Fragment />`; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/InstantiationElements.test.js.snap b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/InstantiationElements.test.js.snap deleted file mode 100644 index 8fa928e..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/InstantiationElements.test.js.snap +++ /dev/null @@ -1,3 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Verify InstantiationElements renders correctly 1`] = `<Fragment />`; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/InstantiationItem.test.js.snap b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/InstantiationItem.test.js.snap deleted file mode 100644 index a3a230a..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/InstantiationItem.test.js.snap +++ /dev/null @@ -1,26 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Verify InstantiationItem renders correctly 1`] = ` -<Accordion> - <styled.div> - <AccordionHeader - index={ - Object { - "index": 0, - } - } - key="[object Object]" - title={ - Object { - "title": "PMSH Instance", - } - } - /> - <AccordionCollapse - eventKey="[object Object]" - > - <Styled(CardBody) /> - </AccordionCollapse> - </styled.div> -</Accordion> -`; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/InstantiationManagementModal.test.js.snap b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/InstantiationManagementModal.test.js.snap deleted file mode 100644 index 21a8dd5..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/InstantiationManagementModal.test.js.snap +++ /dev/null @@ -1,155 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Verify Instantiation Management renders correctly 1`] = ` -<Styled(Modal) - backdrop="static" - keyboard={false} - onHide={[Function]} - show={true} - size="xl" -> - <ModalHeader - closeButton={true} - closeLabel="Close" - > - <ModalTitle> - Manage Instances - </ModalTitle> - </ModalHeader> - <ModalBody> - <Container - fluid={false} - > - <Row - noGutters={false} - > - <Link - to={ - Object { - "pathname": "/editControlLoopInstanceProperties", - } - } - > - <Button - active={false} - disabled={false} - type="null" - variant="primary" - > - Create Instance - </Button> - </Link> - <styled.div /> - <Link - to={ - Object { - "pathname": "/monitorInstantiation", - } - } - > - <Button - active={false} - disabled={false} - type="null" - variant="secondary" - > - Monitor Instantiations - </Button> - </Link> - </Row> - </Container> - <ForwardRef - bordered={true} - style={ - Object { - "marginTop": "10px", - } - } - > - <thead> - <tr> - <th> - # - </th> - <th - style={ - Object { - "textAlign": "center", - } - } - > - Instantiation Name - </th> - <th - style={ - Object { - "textAlign": "center", - } - } - > - Edit Instantiation - </th> - <th - style={ - Object { - "textAlign": "center", - } - } - > - Delete Instantiation - </th> - <th - style={ - Object { - "textAlign": "center", - } - } - > - Change Order State - </th> - <th - style={ - Object { - "textAlign": "center", - } - } - > - Instantiation Order State - </th> - <th - style={ - Object { - "textAlign": "center", - } - } - > - Instantiation Current State - </th> - </tr> - </thead> - <tbody /> - </ForwardRef> - <styled.div /> - </ModalBody> - <ModalFooter> - <Button - active={false} - disabled={false} - onClick={[Function]} - type="null" - variant="secondary" - > - Clear Error Message - </Button> - <Button - active={false} - disabled={false} - onClick={[Function]} - type="null" - variant="secondary" - > - Close - </Button> - </ModalFooter> -</Styled(Modal)> -`; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/InstantiationOrderStateChangeItem.test.js.snap b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/InstantiationOrderStateChangeItem.test.js.snap deleted file mode 100644 index bbf92ca..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/InstantiationOrderStateChangeItem.test.js.snap +++ /dev/null @@ -1,27 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Verify InstantiationOrderStateChangeItem renders correctly 1`] = `<Fragment />`; - -exports[`Verify InstantiationOrderStateChangeItem renders correctly when orderState is passive 1`] = ` -<Fragment> - <styled.div> - PASSIVE_TEST - </styled.div> -</Fragment> -`; - -exports[`Verify InstantiationOrderStateChangeItem renders correctly when orderState is running 1`] = ` -<Fragment> - <styled.div> - RUNNING_TEST - </styled.div> -</Fragment> -`; - -exports[`Verify InstantiationOrderStateChangeItem renders correctly when orderState is uninitialized 1`] = ` -<Fragment> - <styled.div> - UNINITIALISED_TEST - </styled.div> -</Fragment> -`; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/MonitorInstantiation.test.js.snap b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/MonitorInstantiation.test.js.snap deleted file mode 100644 index ad1f7f1..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/MonitorInstantiation.test.js.snap +++ /dev/null @@ -1,41 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Verify MonitorInstantiation renders correctly 1`] = ` -<Styled(Modal) - backdrop="static" - keyboard={false} - onHide={[Function]} - show={true} - size="xl" -> - <ModalHeader - closeButton={true} - closeLabel="Close" - > - <ModalTitle> - Tosca Instantiation - Monitoring - </ModalTitle> - </ModalHeader> - <ModalBody> - <Styled(Alert) - show={false} - variant="danger" - > - Can't get control loop instantiation info: - <br /> - {} - </Styled(Alert)> - </ModalBody> - <ModalFooter> - <Button - active={false} - disabled={false} - onClick={[Function]} - type="null" - variant="secondary" - > - Close - </Button> - </ModalFooter> -</Styled(Modal)> -`; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/ReadAndConvertYaml.test.js.snap b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/ReadAndConvertYaml.test.js.snap deleted file mode 100644 index 76739f3..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/ReadAndConvertYaml.test.js.snap +++ /dev/null @@ -1,63 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Verify ReadAndConvertYaml renders correctly 1`] = ` -<Styled(Modal) - backdrop="static" - keyboard={false} - onHide={[Function]} - show={true} - size="xl" -> - <ModalHeader - closeButton={true} - closeLabel="Close" - > - <ModalTitle> - View Tosca Template - </ModalTitle> - </ModalHeader> - <ModalBody> - <GetToscaTemplate - onGetToscaServiceTemplate={[Function]} - templateName="ToscaServiceTemplateSimple" - templateVersion="1.0.0" - /> - <styled.pre> - - - </styled.pre> - <Styled(Alert) - show={false} - variant="danger" - /> - <Styled(Alert) - show={false} - variant="danger" - > - null - </Styled(Alert)> - <Styled(Alert) - show={false} - variant="success" - > - <h2> - Delete Successful - </h2> - <styled.pre> - null - </styled.pre> - </Styled(Alert)> - </ModalBody> - <ModalFooter> - <Button - active={false} - disabled={false} - onClick={[Function]} - type="null" - variant="secondary" - > - Close - </Button> - </ModalFooter> -</Styled(Modal)> -`; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/UploadToscaFile.test.js.snap b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/UploadToscaFile.test.js.snap deleted file mode 100644 index a1ae439..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/__snapshots__/UploadToscaFile.test.js.snap +++ /dev/null @@ -1,16 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Verify UploadToscaFile renders correctly 1`] = ` -<Fragment> - <Button - active={false} - block={true} - disabled={false} - onClick={[Function]} - type="submit" - variant="primary" - > - Upload Tosca Service Template - </Button> -</Fragment> -`; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/testFiles/commonProps.json b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/testFiles/commonProps.json deleted file mode 100644 index 71f98f8..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/testFiles/commonProps.json +++ /dev/null @@ -1,1444 +0,0 @@ -{ - "org.onap.domain.database.Http_PMSHMicroserviceControlLoopElement": { - "name": "org.onap.domain.database.Http_PMSHMicroserviceControlLoopElement", - "version": "1.2.3", - "derivedFrom": null, - "metadata": {}, - "description": "Control loop element for the http requests of PMSH microservice", - "type": "org.onap.policy.clamp.controlloop.HttpControlLoopElement", - "typeVersion": "1.0.1", - "properties": { - "provider": { - "name": "provider", - "type": "string", - "typeVersion": "0.0.0", - "description": "Specifies the organization that provides the control loop element", - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "passiveToUninitializedTimeout": { - "name": "passiveToUninitializedTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to uninitialized", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "participant_id": { - "name": "participant_id", - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": null, - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "participantType": { - "name": "participantType", - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": "The identity of the participant type that hosts this type of Control Loop Element", - "defaultValue": null, - "required": true, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "uninitializedToPassiveTimeout": { - "name": "uninitializedToPassiveTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from uninitialized to passive", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "startPhase": { - "name": "startPhase", - "type": "integer", - "typeVersion": "0.0.0", - "description": "A value indicating the start phase in which this control loop element will be started, the first start phase is zero. Control Loop Elements are started in their start_phase order and stopped in reverse start phase order. Control Loop Elements with the same start phase are started and stopped simultaneously", - "defaultValue": null, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "runningToPassiveTimeout": { - "name": "runningToPassiveTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from running to passive", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "passiveToRunningTimeout": { - "name": "passiveToRunningTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to running", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - } - }, - "requirements": null, - "capabilities": null, - "identifier": { - "name": "org.onap.domain.database.Http_PMSHMicroserviceControlLoopElement", - "version": "1.2.3" - }, - "typeIdentifier": { - "name": "org.onap.policy.clamp.controlloop.HttpControlLoopElement", - "version": "1.0.1" - }, - "key": { - "name": "org.onap.domain.database.Http_PMSHMicroserviceControlLoopElement", - "version": "1.2.3" - }, - "definedName": "org.onap.domain.database.Http_PMSHMicroserviceControlLoopElement", - "definedVersion": "1.2.3" - }, - "org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement": { - "name": "org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement", - "version": "1.2.3", - "derivedFrom": null, - "metadata": {}, - "description": "Control loop element for the operational policy for Performance Management Subscription Handling", - "type": "org.onap.policy.clamp.controlloop.PolicyControlLoopElement", - "typeVersion": "1.0.0", - "properties": { - "provider": { - "name": "provider", - "type": "string", - "typeVersion": "0.0.0", - "description": "Specifies the organization that provides the control loop element", - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "passiveToUninitializedTimeout": { - "name": "passiveToUninitializedTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to uninitialized", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "participant_id": { - "name": "participant_id", - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": null, - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "participantType": { - "name": "participantType", - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": "The identity of the participant type that hosts this type of Control Loop Element", - "defaultValue": null, - "required": true, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "uninitializedToPassiveTimeout": { - "name": "uninitializedToPassiveTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from uninitialized to passive", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "startPhase": { - "name": "startPhase", - "type": "integer", - "typeVersion": "0.0.0", - "description": "A value indicating the start phase in which this control loop element will be started, the first start phase is zero. Control Loop Elements are started in their start_phase order and stopped in reverse start phase order. Control Loop Elements with the same start phase are started and stopped simultaneously", - "defaultValue": null, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "runningToPassiveTimeout": { - "name": "runningToPassiveTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from running to passive", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "passiveToRunningTimeout": { - "name": "passiveToRunningTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to running", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - } - }, - "requirements": null, - "capabilities": null, - "identifier": { - "name": "org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement", - "version": "1.2.3" - }, - "typeIdentifier": { - "name": "org.onap.policy.clamp.controlloop.PolicyControlLoopElement", - "version": "1.0.0" - }, - "key": { - "name": "org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement", - "version": "1.2.3" - }, - "definedName": "org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement", - "definedVersion": "1.2.3" - }, - "org.onap.domain.database.Local_K8SMicroserviceControlLoopElement": { - "name": "org.onap.domain.database.Local_K8SMicroserviceControlLoopElement", - "version": "1.2.3", - "derivedFrom": null, - "metadata": {}, - "description": "Control loop element for the K8S microservice for local chart", - "type": "org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement", - "typeVersion": "1.0.0", - "properties": { - "provider": { - "name": "provider", - "type": "string", - "typeVersion": "0.0.0", - "description": "Specifies the organization that provides the control loop element", - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "passiveToUninitializedTimeout": { - "name": "passiveToUninitializedTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to uninitialized", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "participant_id": { - "name": "participant_id", - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": null, - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "participantType": { - "name": "participantType", - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": "The identity of the participant type that hosts this type of Control Loop Element", - "defaultValue": null, - "required": true, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "uninitializedToPassiveTimeout": { - "name": "uninitializedToPassiveTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from uninitialized to passive", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "startPhase": { - "name": "startPhase", - "type": "integer", - "typeVersion": "0.0.0", - "description": "A value indicating the start phase in which this control loop element will be started, the first start phase is zero. Control Loop Elements are started in their start_phase order and stopped in reverse start phase order. Control Loop Elements with the same start phase are started and stopped simultaneously", - "defaultValue": null, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "runningToPassiveTimeout": { - "name": "runningToPassiveTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from running to passive", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "passiveToRunningTimeout": { - "name": "passiveToRunningTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to running", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - } - }, - "requirements": null, - "capabilities": null, - "identifier": { - "name": "org.onap.domain.database.Local_K8SMicroserviceControlLoopElement", - "version": "1.2.3" - }, - "typeIdentifier": { - "name": "org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement", - "version": "1.0.0" - }, - "key": { - "name": "org.onap.domain.database.Local_K8SMicroserviceControlLoopElement", - "version": "1.2.3" - }, - "definedName": "org.onap.domain.database.Local_K8SMicroserviceControlLoopElement", - "definedVersion": "1.2.3" - }, - "org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement": { - "name": "org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement", - "version": "1.2.3", - "derivedFrom": null, - "metadata": {}, - "description": "Control loop element for the monitoring policy for Performance Management Subscription Handling", - "type": "org.onap.policy.clamp.controlloop.PolicyControlLoopElement", - "typeVersion": "1.0.0", - "properties": { - "provider": { - "name": "provider", - "type": "string", - "typeVersion": "0.0.0", - "description": "Specifies the organization that provides the control loop element", - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "passiveToUninitializedTimeout": { - "name": "passiveToUninitializedTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to uninitialized", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "participant_id": { - "name": "participant_id", - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": null, - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "participantType": { - "name": "participantType", - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": "The identity of the participant type that hosts this type of Control Loop Element", - "defaultValue": null, - "required": true, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "uninitializedToPassiveTimeout": { - "name": "uninitializedToPassiveTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from uninitialized to passive", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "startPhase": { - "name": "startPhase", - "type": "integer", - "typeVersion": "0.0.0", - "description": "A value indicating the start phase in which this control loop element will be started, the first start phase is zero. Control Loop Elements are started in their start_phase order and stopped in reverse start phase order. Control Loop Elements with the same start phase are started and stopped simultaneously", - "defaultValue": null, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "runningToPassiveTimeout": { - "name": "runningToPassiveTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from running to passive", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "passiveToRunningTimeout": { - "name": "passiveToRunningTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to running", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - } - }, - "requirements": null, - "capabilities": null, - "identifier": { - "name": "org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement", - "version": "1.2.3" - }, - "typeIdentifier": { - "name": "org.onap.policy.clamp.controlloop.PolicyControlLoopElement", - "version": "1.0.0" - }, - "key": { - "name": "org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement", - "version": "1.2.3" - }, - "definedName": "org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement", - "definedVersion": "1.2.3" - }, - "org.onap.domain.pmsh.DerivedDerivedPolicyControlLoopElement": { - "name": "org.onap.domain.pmsh.DerivedDerivedPolicyControlLoopElement", - "version": "1.2.3", - "derivedFrom": null, - "metadata": {}, - "description": "Control loop for Performance Management Subscription Handling", - "type": "org.onap.policy.clamp.controlloop.DerivedDerivedPolicyControlLoopElement", - "typeVersion": "1.0.0", - "properties": { - "provider": { - "name": "provider", - "type": "string", - "typeVersion": "0.0.0", - "description": "Specifies the organization that provides the control loop element", - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "passiveToUninitializedTimeout": { - "name": "passiveToUninitializedTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to uninitialized", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "participant_id": { - "name": "participant_id", - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": null, - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "participantType": { - "name": "participantType", - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": "The identity of the participant type that hosts this type of Control Loop Element", - "defaultValue": null, - "required": true, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "uninitializedToPassiveTimeout": { - "name": "uninitializedToPassiveTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from uninitialized to passive", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "startPhase": { - "name": "startPhase", - "type": "integer", - "typeVersion": "0.0.0", - "description": "A value indicating the start phase in which this control loop element will be started, the first start phase is zero. Control Loop Elements are started in their start_phase order and stopped in reverse start phase order. Control Loop Elements with the same start phase are started and stopped simultaneously", - "defaultValue": null, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "runningToPassiveTimeout": { - "name": "runningToPassiveTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from running to passive", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "passiveToRunningTimeout": { - "name": "passiveToRunningTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to running", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - } - }, - "requirements": null, - "capabilities": null, - "identifier": { - "name": "org.onap.domain.pmsh.DerivedDerivedPolicyControlLoopElement", - "version": "1.2.3" - }, - "typeIdentifier": { - "name": "org.onap.policy.clamp.controlloop.DerivedDerivedPolicyControlLoopElement", - "version": "1.0.0" - }, - "key": { - "name": "org.onap.domain.pmsh.DerivedDerivedPolicyControlLoopElement", - "version": "1.2.3" - }, - "definedName": "org.onap.domain.pmsh.DerivedDerivedPolicyControlLoopElement", - "definedVersion": "1.2.3" - }, - "org.onap.domain.sample.GenericK8s_ControlLoopDefinition": { - "name": "org.onap.domain.sample.GenericK8s_ControlLoopDefinition", - "version": "1.2.3", - "derivedFrom": null, - "metadata": {}, - "description": "Control loop for Hello World", - "type": "org.onap.policy.clamp.controlloop.ControlLoop", - "typeVersion": "1.0.0", - "properties": { - "provider": { - "name": "provider", - "type": "string", - "typeVersion": "0.0.0", - "description": "Specifies the organization that provides the control loop element", - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "elements": { - "name": "elements", - "type": "list", - "typeVersion": "0.0.0", - "description": "Specifies a list of control loop element definitions that make up this control loop definition", - "defaultValue": null, - "required": true, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": { - "name": null, - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": null, - "constraints": null - }, - "metadata": { - "common": "true" - } - } - }, - "requirements": null, - "capabilities": null, - "identifier": { - "name": "org.onap.domain.sample.GenericK8s_ControlLoopDefinition", - "version": "1.2.3" - }, - "typeIdentifier": { - "name": "org.onap.policy.clamp.controlloop.ControlLoop", - "version": "1.0.0" - }, - "key": { - "name": "org.onap.domain.sample.GenericK8s_ControlLoopDefinition", - "version": "1.2.3" - }, - "definedName": "org.onap.domain.sample.GenericK8s_ControlLoopDefinition", - "definedVersion": "1.2.3" - }, - "org.onap.domain.database.PMSH_K8SMicroserviceControlLoopElement": { - "name": "org.onap.domain.database.PMSH_K8SMicroserviceControlLoopElement", - "version": "1.2.3", - "derivedFrom": null, - "metadata": {}, - "description": "Control loop element for the K8S microservice for PMSH", - "type": "org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement", - "typeVersion": "1.0.0", - "properties": { - "provider": { - "name": "provider", - "type": "string", - "typeVersion": "0.0.0", - "description": "Specifies the organization that provides the control loop element", - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "passiveToUninitializedTimeout": { - "name": "passiveToUninitializedTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to uninitialized", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "participant_id": { - "name": "participant_id", - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": null, - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "participantType": { - "name": "participantType", - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": "The identity of the participant type that hosts this type of Control Loop Element", - "defaultValue": null, - "required": true, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "uninitializedToPassiveTimeout": { - "name": "uninitializedToPassiveTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from uninitialized to passive", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "startPhase": { - "name": "startPhase", - "type": "integer", - "typeVersion": "0.0.0", - "description": "A value indicating the start phase in which this control loop element will be started, the first start phase is zero. Control Loop Elements are started in their start_phase order and stopped in reverse start phase order. Control Loop Elements with the same start phase are started and stopped simultaneously", - "defaultValue": null, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "runningToPassiveTimeout": { - "name": "runningToPassiveTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from running to passive", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "passiveToRunningTimeout": { - "name": "passiveToRunningTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to running", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - } - }, - "requirements": null, - "capabilities": null, - "identifier": { - "name": "org.onap.domain.database.PMSH_K8SMicroserviceControlLoopElement", - "version": "1.2.3" - }, - "typeIdentifier": { - "name": "org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement", - "version": "1.0.0" - }, - "key": { - "name": "org.onap.domain.database.PMSH_K8SMicroserviceControlLoopElement", - "version": "1.2.3" - }, - "definedName": "org.onap.domain.database.PMSH_K8SMicroserviceControlLoopElement", - "definedVersion": "1.2.3" - }, - "org.onap.domain.pmsh.DerivedPolicyControlLoopElement": { - "name": "org.onap.domain.pmsh.DerivedPolicyControlLoopElement", - "version": "1.2.3", - "derivedFrom": null, - "metadata": {}, - "description": "Control loop for Performance Management Subscription Handling", - "type": "org.onap.policy.clamp.controlloop.DerivedPolicyControlLoopElement", - "typeVersion": "1.0.0", - "properties": { - "provider": { - "name": "provider", - "type": "string", - "typeVersion": "0.0.0", - "description": "Specifies the organization that provides the control loop element", - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "passiveToUninitializedTimeout": { - "name": "passiveToUninitializedTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to uninitialized", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "participant_id": { - "name": "participant_id", - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": null, - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "participantType": { - "name": "participantType", - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": "The identity of the participant type that hosts this type of Control Loop Element", - "defaultValue": null, - "required": true, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "uninitializedToPassiveTimeout": { - "name": "uninitializedToPassiveTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from uninitialized to passive", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "startPhase": { - "name": "startPhase", - "type": "integer", - "typeVersion": "0.0.0", - "description": "A value indicating the start phase in which this control loop element will be started, the first start phase is zero. Control Loop Elements are started in their start_phase order and stopped in reverse start phase order. Control Loop Elements with the same start phase are started and stopped simultaneously", - "defaultValue": null, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "runningToPassiveTimeout": { - "name": "runningToPassiveTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from running to passive", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - }, - "passiveToRunningTimeout": { - "name": "passiveToRunningTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to running", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "true" - } - } - }, - "requirements": null, - "capabilities": null, - "identifier": { - "name": "org.onap.domain.pmsh.DerivedPolicyControlLoopElement", - "version": "1.2.3" - }, - "typeIdentifier": { - "name": "org.onap.policy.clamp.controlloop.DerivedPolicyControlLoopElement", - "version": "1.0.0" - }, - "key": { - "name": "org.onap.domain.pmsh.DerivedPolicyControlLoopElement", - "version": "1.2.3" - }, - "definedName": "org.onap.domain.pmsh.DerivedPolicyControlLoopElement", - "definedVersion": "1.2.3" - } -} diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/testFiles/controlLoopList.json b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/testFiles/controlLoopList.json deleted file mode 100644 index d549879..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/testFiles/controlLoopList.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "controlLoopList": [ - { - "name": "PMSHInstance0", - "version": "1.0.1", - "definition": { - "name": "org.onap.domain.pmsh.PMSHControlLoopDefinition", - "version": "1.2.3" - }, - "state": "UNINITIALISED", - "orderedState": "UNINITIALISED", - "description": "PMSH control loop instance 0", - "elements": { - "709c62b3-8918-41b9-a747-d21eb79c6c20": { - "id": "709c62b3-8918-41b9-a747-d21eb79c6c20", - "definition": { - "name": "org.onap.domain.pmsh.PMSH_DCAEMicroservice", - "version": "1.2.3" - }, - "participantType": { - "name": "org.onap.dcae.controlloop.DCAEMicroserviceControlLoopParticipant", - "version": "2.3.4" - }, - "state": "UNINITIALISED", - "orderedState": "UNINITIALISED", - "description": "DCAE Control Loop Element for the PMSH instance 0 control loop" - }, - "709c62b3-8918-41b9-a747-d21eb79c6c21": { - "id": "709c62b3-8918-41b9-a747-d21eb79c6c21", - "definition": { - "name": "org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement", - "version": "1.2.3" - }, - "participantType": { - "name": "org.onap.policy.controlloop.PolicyControlLoopParticipant", - "version": "2.3.1" - }, - "state": "UNINITIALISED", - "orderedState": "UNINITIALISED", - "description": "Monitoring Policy Control Loop Element for the PMSH instance 0 control loop" - }, - "709c62b3-8918-41b9-a747-d21eb79c6c22": { - "id": "709c62b3-8918-41b9-a747-d21eb79c6c22", - "definition": { - "name": "org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement", - "version": "1.2.3" - }, - "participantType": { - "name": "org.onap.policy.controlloop.PolicyControlLoopParticipant", - "version": "2.3.1" - }, - "state": "UNINITIALISED", - "orderedState": "UNINITIALISED", - "description": "Operational Policy Control Loop Element for the PMSH instance 0 control loop" - } - } - } - ] -} diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/testFiles/fullTemplate.json b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/testFiles/fullTemplate.json deleted file mode 100644 index 8b77554..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/testFiles/fullTemplate.json +++ /dev/null @@ -1,2194 +0,0 @@ -{ - "policy_types": { - "onap.policies.Monitoring": { - "name": "onap.policies.Monitoring", - "version": "1.0.0", - "derived_from": "tosca.policies.Root", - "metadata": {}, - "description": "a base policy type for all policies that govern monitoring provisioning", - "properties": {}, - "key": { - "name": "onap.policies.Monitoring", - "version": "1.0.0" - }, - "type": null, - "type_version": null, - "defined_name": "onap.policies.Monitoring", - "defined_version": "1.0.0" - }, - "onap.policies.Sirisha": { - "name": "onap.policies.Sirisha", - "version": "1.0.0", - "derived_from": "tosca.policies.Root", - "metadata": {}, - "description": "a base policy type for all policies that govern monitoring provisioning", - "properties": {}, - "key": { - "name": "onap.policies.Sirisha", - "version": "1.0.0" - }, - "type": null, - "type_version": null, - "defined_name": "onap.policies.Sirisha", - "defined_version": "1.0.0" - }, - "onap.policies.controlloop.operational.Common": { - "name": "onap.policies.controlloop.operational.Common", - "version": "1.0.0", - "derived_from": "tosca.policies.Root", - "metadata": {}, - "description": "Operational Policy for Control Loop execution. Originated in Frankfurt to support TOSCA Compliant\nPolicy Types. This does NOT support the legacy Policy YAML policy type.\n", - "properties": { - "abatement": { - "name": "abatement", - "type": "boolean", - "type_version": "0.0.0", - "description": "Whether an abatement event message will be expected for the control loop from DCAE.", - "default_value": false, - "required": true, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "operations": { - "name": "operations", - "type": "list", - "type_version": "0.0.0", - "description": "List of operations to be performed when Control Loop is triggered.", - "default_value": null, - "required": true, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": { - "name": null, - "type": "onap.datatype.controlloop.Operation", - "type_version": "0.0.0", - "description": null, - "constraints": null - }, - "metadata": null - }, - "trigger": { - "name": "trigger", - "type": "string", - "type_version": "0.0.0", - "description": "Initial operation to execute upon receiving an Onset event message for the Control Loop.", - "default_value": null, - "required": true, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "timeout": { - "name": "timeout", - "type": "integer", - "type_version": "0.0.0", - "description": "Overall timeout for executing all the operations. This timeout should equal or exceed the total\ntimeout for each operation listed.\n", - "default_value": null, - "required": true, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "id": { - "name": "id", - "type": "string", - "type_version": "0.0.0", - "description": "The unique control loop id.", - "default_value": null, - "required": true, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - } - }, - "key": { - "name": "onap.policies.controlloop.operational.Common", - "version": "1.0.0" - }, - "type": null, - "type_version": null, - "defined_name": "onap.policies.controlloop.operational.Common", - "defined_version": "1.0.0" - }, - "onap.policies.controlloop.operational.common.Apex": { - "name": "onap.policies.controlloop.operational.common.Apex", - "version": "1.0.0", - "derived_from": "onap.policies.controlloop.operational.Common", - "metadata": {}, - "description": "Operational policies for Apex PDP", - "properties": { - "engineServiceParameters": { - "name": "engineServiceParameters", - "type": "string", - "type_version": "0.0.0", - "description": "The engine parameters like name, instanceCount, policy implementation, parameters etc.", - "default_value": null, - "required": true, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "eventOutputParameters": { - "name": "eventOutputParameters", - "type": "string", - "type_version": "0.0.0", - "description": "The event output parameters.", - "default_value": null, - "required": true, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "javaProperties": { - "name": "javaProperties", - "type": "string", - "type_version": "0.0.0", - "description": "Name/value pairs of properties to be set for APEX if needed.", - "default_value": null, - "required": false, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "eventInputParameters": { - "name": "eventInputParameters", - "type": "string", - "type_version": "0.0.0", - "description": "The event input parameters.", - "default_value": null, - "required": true, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - } - }, - "key": { - "name": "onap.policies.controlloop.operational.common.Apex", - "version": "1.0.0" - }, - "type": null, - "type_version": null, - "defined_name": "onap.policies.controlloop.operational.common.Apex", - "defined_version": "1.0.0" - }, - "onap.policies.monitoring.dcae-pm-subscription-handler": { - "name": "onap.policies.monitoring.dcae-pm-subscription-handler", - "version": "1.0.0", - "derived_from": "onap.policies.Monitoring", - "metadata": {}, - "description": null, - "properties": { - "pmsh_policy": { - "name": "pmsh_policy", - "type": "onap.datatypes.monitoring.subscription", - "type_version": "0.0.0", - "description": "PMSH Policy JSON", - "default_value": null, - "required": false, - "status": null, - "constraints": [], - "key_schema": null, - "entry_schema": null, - "metadata": {} - } - }, - "key": { - "name": "onap.policies.monitoring.dcae-pm-subscription-handler", - "version": "1.0.0" - }, - "type": null, - "type_version": null, - "defined_name": "onap.policies.monitoring.dcae-pm-subscription-handler", - "defined_version": "1.0.0" - } - }, - "node_types": { - "org.onap.policy.clamp.controlloop.CDSControlLoopElement": { - "name": "org.onap.policy.clamp.controlloop.CDSControlLoopElement", - "version": "1.0.1", - "derived_from": "org.onap.policy.clamp.controlloop.ControlLoopElement", - "metadata": {}, - "description": null, - "properties": { - "cds_blueprint_id": { - "name": "cds_blueprint_id", - "type": "onap.datatypes.ToscaConceptIdentifier", - "type_version": "0.0.0", - "description": null, - "default_value": null, - "required": false, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - } - }, - "requirements": null, - "key": { - "name": "org.onap.policy.clamp.controlloop.CDSControlLoopElement", - "version": "1.0.1" - }, - "type": null, - "type_version": null, - "defined_name": "org.onap.policy.clamp.controlloop.CDSControlLoopElement", - "defined_version": "1.0.1" - }, - "org.onap.policy.clamp.controlloop.ControlLoop": { - "name": "org.onap.policy.clamp.controlloop.ControlLoop", - "version": "1.0.1", - "derived_from": "tosca.nodetypes.Root", - "metadata": {}, - "description": null, - "properties": { - "elements": { - "name": "elements", - "type": "list", - "type_version": "0.0.0", - "description": "Specifies a list of control loop element definitions that make up this control loop definition", - "default_value": null, - "required": true, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": { - "name": null, - "type": "onap.datatypes.ToscaConceptIdentifier", - "type_version": "0.0.0", - "description": null, - "constraints": null - }, - "metadata": { - "common": "true" - } - }, - "provider": { - "name": "provider", - "type": "string", - "type_version": "0.0.0", - "description": "Specifies the organization that provides the control loop element", - "default_value": null, - "required": false, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": { - "common": "true" - } - } - }, - "requirements": null, - "key": { - "name": "org.onap.policy.clamp.controlloop.ControlLoop", - "version": "1.0.1" - }, - "type": null, - "type_version": null, - "defined_name": "org.onap.policy.clamp.controlloop.ControlLoop", - "defined_version": "1.0.1" - }, - "org.onap.policy.clamp.controlloop.ControlLoopElement": { - "name": "org.onap.policy.clamp.controlloop.ControlLoopElement", - "version": "1.0.1", - "derived_from": "tosca.nodetypes.Root", - "metadata": {}, - "description": null, - "properties": { - "runningToPassiveTimeout": { - "name": "runningToPassiveTimeout", - "type": "integer", - "type_version": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from running to passive", - "default_value": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "valid_values": null, - "equal": null, - "greater_than": null, - "greater_or_equal": "0", - "less_than": null, - "less_or_equal": null, - "range_values": null - } - ], - "key_schema": null, - "entry_schema": null, - "metadata": { - "common": "true" - } - }, - "participantType": { - "name": "participantType", - "type": "onap.datatypes.ToscaConceptIdentifier", - "type_version": "0.0.0", - "description": "The identity of the participant type that hosts this type of Control Loop Element", - "default_value": null, - "required": true, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": { - "common": "true" - } - }, - "provider": { - "name": "provider", - "type": "string", - "type_version": "0.0.0", - "description": "Specifies the organization that provides the control loop element", - "default_value": null, - "required": false, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": { - "common": "true" - } - }, - "startPhase": { - "name": "startPhase", - "type": "integer", - "type_version": "0.0.0", - "description": "A value indicating the start phase in which this control loop element will be started, the first start phase is zero. Control Loop Elements are started in their start_phase order and stopped in reverse start phase order. Control Loop Elements with the same start phase are started and stopped simultaneously", - "default_value": null, - "required": false, - "status": null, - "constraints": [ - { - "valid_values": null, - "equal": null, - "greater_than": null, - "greater_or_equal": "0", - "less_than": null, - "less_or_equal": null, - "range_values": null - } - ], - "key_schema": null, - "entry_schema": null, - "metadata": { - "common": "true" - } - }, - "passiveToUninitializedTimeout": { - "name": "passiveToUninitializedTimeout", - "type": "integer", - "type_version": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to uninitialized", - "default_value": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "valid_values": null, - "equal": null, - "greater_than": null, - "greater_or_equal": "0", - "less_than": null, - "less_or_equal": null, - "range_values": null - } - ], - "key_schema": null, - "entry_schema": null, - "metadata": { - "common": "true" - } - }, - "uninitializedToPassiveTimeout": { - "name": "uninitializedToPassiveTimeout", - "type": "integer", - "type_version": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from uninitialized to passive", - "default_value": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "valid_values": null, - "equal": null, - "greater_than": null, - "greater_or_equal": "0", - "less_than": null, - "less_or_equal": null, - "range_values": null - } - ], - "key_schema": null, - "entry_schema": null, - "metadata": { - "common": "true" - } - }, - "participant_id": { - "name": "participant_id", - "type": "onap.datatypes.ToscaConceptIdentifier", - "type_version": "0.0.0", - "description": null, - "default_value": null, - "required": false, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": { - "common": "true" - } - }, - "passiveToRunningTimeout": { - "name": "passiveToRunningTimeout", - "type": "integer", - "type_version": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to running", - "default_value": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "valid_values": null, - "equal": null, - "greater_than": null, - "greater_or_equal": "0", - "less_than": null, - "less_or_equal": null, - "range_values": null - } - ], - "key_schema": null, - "entry_schema": null, - "metadata": { - "common": "true" - } - } - }, - "requirements": null, - "key": { - "name": "org.onap.policy.clamp.controlloop.ControlLoopElement", - "version": "1.0.1" - }, - "type": null, - "type_version": null, - "defined_name": "org.onap.policy.clamp.controlloop.ControlLoopElement", - "defined_version": "1.0.1" - }, - "org.onap.policy.clamp.controlloop.DerivedDerivedPolicyControlLoopElement": { - "name": "org.onap.policy.clamp.controlloop.DerivedDerivedPolicyControlLoopElement", - "version": "1.0.1", - "derived_from": "org.onap.policy.clamp.controlloop.DerivedPolicyControlLoopElement", - "metadata": {}, - "description": null, - "properties": { - "policy_id": { - "name": "policy_id", - "type": "onap.datatypes.ToscaConceptIdentifier", - "type_version": "0.0.0", - "description": null, - "default_value": null, - "required": false, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "policy_type_id": { - "name": "policy_type_id", - "type": "onap.datatypes.ToscaConceptIdentifier", - "type_version": "0.0.0", - "description": null, - "default_value": null, - "required": false, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - } - }, - "requirements": null, - "key": { - "name": "org.onap.policy.clamp.controlloop.DerivedDerivedPolicyControlLoopElement", - "version": "1.0.1" - }, - "type": null, - "type_version": null, - "defined_name": "org.onap.policy.clamp.controlloop.DerivedDerivedPolicyControlLoopElement", - "defined_version": "1.0.1" - }, - "org.onap.policy.clamp.controlloop.DerivedPolicyControlLoopElement": { - "name": "org.onap.policy.clamp.controlloop.DerivedPolicyControlLoopElement", - "version": "1.0.1", - "derived_from": "org.onap.policy.clamp.controlloop.PolicyControlLoopElement", - "metadata": {}, - "description": null, - "properties": { - "policy_id": { - "name": "policy_id", - "type": "onap.datatypes.ToscaConceptIdentifier", - "type_version": "0.0.0", - "description": null, - "default_value": null, - "required": false, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "policy_type_id": { - "name": "policy_type_id", - "type": "onap.datatypes.ToscaConceptIdentifier", - "type_version": "0.0.0", - "description": null, - "default_value": null, - "required": false, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - } - }, - "requirements": null, - "key": { - "name": "org.onap.policy.clamp.controlloop.DerivedPolicyControlLoopElement", - "version": "1.0.1" - }, - "type": null, - "type_version": null, - "defined_name": "org.onap.policy.clamp.controlloop.DerivedPolicyControlLoopElement", - "defined_version": "1.0.1" - }, - "org.onap.policy.clamp.controlloop.HttpControlLoopElement": { - "name": "org.onap.policy.clamp.controlloop.HttpControlLoopElement", - "version": "1.0.1", - "derived_from": "org.onap.policy.clamp.controlloop.ControlLoopElement", - "metadata": {}, - "description": null, - "properties": { - "httpHeaders": { - "name": "httpHeaders", - "type": "map", - "type_version": "0.0.0", - "description": "HTTP headers to send on REST requests", - "default_value": null, - "required": false, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": { - "name": null, - "type": "string", - "type_version": "0.0.0", - "description": null, - "constraints": null - }, - "metadata": null - }, - "baseUrl": { - "name": "baseUrl", - "type": "string", - "type_version": "0.0.0", - "description": "The base URL to be prepended to each path, identifies the host for the REST endpoints.", - "default_value": null, - "required": true, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "configurationEntities": { - "name": "configurationEntities", - "type": "map", - "type_version": "0.0.0", - "description": "The connfiguration entities the Control Loop Element is managing and their associated REST requests", - "default_value": null, - "required": true, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": { - "name": null, - "type": "org.onap.datatypes.policy.clamp.controlloop.httpControlLoopElement.ConfigurationEntity", - "type_version": "0.0.0", - "description": null, - "constraints": null - }, - "metadata": null - } - }, - "requirements": null, - "key": { - "name": "org.onap.policy.clamp.controlloop.HttpControlLoopElement", - "version": "1.0.1" - }, - "type": null, - "type_version": null, - "defined_name": "org.onap.policy.clamp.controlloop.HttpControlLoopElement", - "defined_version": "1.0.1" - }, - "org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement": { - "name": "org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement", - "version": "1.0.1", - "derived_from": "org.onap.policy.clamp.controlloop.ControlLoopElement", - "metadata": {}, - "description": null, - "properties": { - "values": { - "name": "values", - "type": "string", - "type_version": "0.0.0", - "description": null, - "default_value": null, - "required": false, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "templates": { - "name": "templates", - "type": "list", - "type_version": "0.0.0", - "description": null, - "default_value": null, - "required": false, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "chart": { - "name": "chart", - "type": "string", - "type_version": "0.0.0", - "description": null, - "default_value": null, - "required": true, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "requirements": { - "name": "requirements", - "type": "string", - "type_version": "0.0.0", - "description": null, - "default_value": null, - "required": false, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "configs": { - "name": "configs", - "type": "list", - "type_version": "0.0.0", - "description": null, - "default_value": null, - "required": false, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - } - }, - "requirements": null, - "key": { - "name": "org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement", - "version": "1.0.1" - }, - "type": null, - "type_version": null, - "defined_name": "org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement", - "defined_version": "1.0.1" - }, - "org.onap.policy.clamp.controlloop.Participant": { - "name": "org.onap.policy.clamp.controlloop.Participant", - "version": "1.0.1", - "derived_from": "tosca.nodetypes.Root", - "metadata": {}, - "description": null, - "properties": { - "provider": { - "name": "provider", - "type": "string", - "type_version": "0.0.0", - "description": null, - "default_value": null, - "required": false, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - } - }, - "requirements": null, - "key": { - "name": "org.onap.policy.clamp.controlloop.Participant", - "version": "1.0.1" - }, - "type": null, - "type_version": null, - "defined_name": "org.onap.policy.clamp.controlloop.Participant", - "defined_version": "1.0.1" - }, - "org.onap.policy.clamp.controlloop.PolicyControlLoopElement": { - "name": "org.onap.policy.clamp.controlloop.PolicyControlLoopElement", - "version": "1.0.1", - "derived_from": "org.onap.policy.clamp.controlloop.ControlLoopElement", - "metadata": {}, - "description": null, - "properties": { - "policy_id": { - "name": "policy_id", - "type": "onap.datatypes.ToscaConceptIdentifier", - "type_version": "0.0.0", - "description": null, - "default_value": null, - "required": false, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "policy_type_id": { - "name": "policy_type_id", - "type": "onap.datatypes.ToscaConceptIdentifier", - "type_version": "0.0.0", - "description": null, - "default_value": null, - "required": false, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - } - }, - "requirements": null, - "key": { - "name": "org.onap.policy.clamp.controlloop.PolicyControlLoopElement", - "version": "1.0.1" - }, - "type": null, - "type_version": null, - "defined_name": "org.onap.policy.clamp.controlloop.PolicyControlLoopElement", - "defined_version": "1.0.1" - } - }, - "topology_template": { - "description": null, - "inputs": { - "pmsh_operational_policy": { - "name": "pmsh_operational_policy", - "type": "onap.datatypes.ToscaConceptIdentifier", - "type_version": "0.0.0", - "value": null - }, - "pmsh_monitoring_policy": { - "name": "pmsh_monitoring_policy", - "type": "onap.datatypes.ToscaConceptIdentifier", - "type_version": "0.0.0", - "value": null - } - }, - "node_templates": { - "org.onap.controlloop.HttpControlLoopParticipant": { - "name": "org.onap.controlloop.HttpControlLoopParticipant", - "version": "2.3.4", - "derived_from": null, - "metadata": {}, - "description": "Participant for Http requests", - "type": "org.onap.policy.clamp.controlloop.Participant", - "type_version": "1.0.1", - "properties": { - "provider": "ONAP" - }, - "requirements": null, - "capabilities": null, - "identifier": { - "name": "org.onap.controlloop.HttpControlLoopParticipant", - "version": "2.3.4" - }, - "type_identifier": { - "name": "org.onap.policy.clamp.controlloop.Participant", - "version": "1.0.1" - }, - "key": { - "name": "org.onap.controlloop.HttpControlLoopParticipant", - "version": "2.3.4" - }, - "defined_name": "org.onap.controlloop.HttpControlLoopParticipant", - "defined_version": "2.3.4" - }, - "org.onap.domain.database.Http_PMSHMicroserviceControlLoopElement": { - "name": "org.onap.domain.database.Http_PMSHMicroserviceControlLoopElement", - "version": "1.2.3", - "derived_from": null, - "metadata": {}, - "description": "Control loop element for the http requests of PMSH microservice", - "type": "org.onap.policy.clamp.controlloop.HttpControlLoopElement", - "type_version": "1.0.1", - "properties": { - "participantType": { - "name": "org.onap.k8s.controlloop.HttpControlLoopParticipant", - "version": "2.3.4" - }, - "configurationEntities": [ - { - "configurationEntityId": { - "name": "entity1", - "version": "1.0.1" - }, - "restSequence": [ - { - "restRequestId": { - "name": "request1", - "version": "1.0.1" - }, - "httpMethod": "PUT", - "path": "v1/kv/dcae-pmsh2", - "body": "{ \"control_loop_name\":\"pmsh-control-loop\", \"operational_policy_name\":\"pmsh-operational-policy\", \"aaf_password\":\"demo123456!\", \"aaf_identity\":\"dcae@dcae.onap.org\", \"cert_path\":\"/opt/app/pmsh/etc/certs/cert.pem\", \"key_path\":\"/opt/app/pmsh/etc/certs/key.pem\", \"ca_cert_path\":\"/opt/app/pmsh/etc/certs/cacert.pem\", \"enable_tls\":\"true\", \"pmsh_policy\":{ \"subscription\":{ \"subscriptionName\":\"ExtraPM-All-gNB-R2B\", \"administrativeState\":\"UNLOCKED\", \"fileBasedGP\":15, \"fileLocation\":\"\/pm\/pm.xml\", \"nfFilter\":{ \"nfNames\":[ \"^pnf.*\", \"^vnf.*\" ], \"modelInvariantIDs\":[ ], \"modelVersionIDs\":[ ], \"modelNames\":[ ] }, \"measurementGroups\":[ { \"measurementGroup\":{ \"measurementTypes\":[ { \"measurementType\":\"countera\" }, { \"measurementType\":\"counterb\" } ], \"managedObjectDNsBasic\":[ { \"DN\":\"dna\" }, { \"DN\":\"dnb\" } ] } }, { \"measurementGroup\":{ \"measurementTypes\":[ { \"measurementType\":\"counterc\" }, { \"measurementType\":\"counterd\" } ], \"managedObjectDNsBasic\":[ { \"DN\":\"dnc\" }, { \"DN\":\"dnd\" } ] } } ] } }, \"streams_subscribes\":{ \"aai_subscriber\":{ \"type\":\"message_router\", \"dmaap_info\":{ \"topic_url\":\"https://10.152.183.151:3905/events/AAI_EVENT\", \"client_role\":\"org.onap.dcae.aaiSub\", \"location\":\"san-francisco\", \"client_id\":\"1575976809466\" } }, \"policy_pm_subscriber\":{ \"type\":\"message_router\", \"dmaap_info\":{ \"topic_url\":\"https://10.152.183.151:3905/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS\", \"client_role\":\"org.onap.dcae.pmSubscriber\", \"location\":\"san-francisco\", \"client_id\":\"1575876809456\" } } }, \"streams_publishes\":{ \"policy_pm_publisher\":{ \"type\":\"message_router\", \"dmaap_info\":{ \"topic_url\":\"https://10.152.183.151:3905/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS\", \"client_role\":\"org.onap.dcae.pmPublisher\", \"location\":\"san-francisco\", \"client_id\":\"1475976809466\" } }, \"other_publisher\":{ \"type\":\"message_router\", \"dmaap_info\":{ \"topic_url\":\"https://10.152.183.151:3905/events/org.onap.dmaap.mr.SOME_OTHER_TOPIC\", \"client_role\":\"org.onap.dcae.pmControlPub\", \"location\":\"san-francisco\", \"client_id\":\"1875976809466\" } } } }", - "expectedResponse": 200 - } - ] - } - ], - "provider": "ONAP", - "startPhase": 1, - "uninitializedToPassiveTimeout": 180, - "httpHeaders": { - "Content-Type": "application/json" - }, - "participant_id": { - "name": "HttpParticipant0", - "version": "1.0.0" - }, - "baseUrl": "http://10.152.183.51:8500" - }, - "requirements": null, - "capabilities": null, - "identifier": { - "name": "org.onap.domain.database.Http_PMSHMicroserviceControlLoopElement", - "version": "1.2.3" - }, - "type_identifier": { - "name": "org.onap.policy.clamp.controlloop.HttpControlLoopElement", - "version": "1.0.1" - }, - "key": { - "name": "org.onap.domain.database.Http_PMSHMicroserviceControlLoopElement", - "version": "1.2.3" - }, - "defined_name": "org.onap.domain.database.Http_PMSHMicroserviceControlLoopElement", - "defined_version": "1.2.3" - }, - "org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement": { - "name": "org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement", - "version": "1.2.3", - "derived_from": null, - "metadata": {}, - "description": "Control loop element for the operational policy for Performance Management Subscription Handling", - "type": "org.onap.policy.clamp.controlloop.PolicyControlLoopElement", - "type_version": "1.0.0", - "properties": { - "participant_id": { - "name": "org.onap.PM_Policy", - "version": "1.0.0" - }, - "policy_type_id": { - "name": "onap.policies.operational.pm-subscription-handler", - "version": "1.0.0" - }, - "participantType": { - "name": "org.onap.policy.controlloop.PolicyControlLoopParticipant", - "version": "2.3.1" - }, - "provider": "Ericsson", - "policy_id": { - "get_input": "pmsh_operational_policy" - } - }, - "requirements": null, - "capabilities": null, - "identifier": { - "name": "org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement", - "version": "1.2.3" - }, - "type_identifier": { - "name": "org.onap.policy.clamp.controlloop.PolicyControlLoopElement", - "version": "1.0.0" - }, - "key": { - "name": "org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement", - "version": "1.2.3" - }, - "defined_name": "org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement", - "defined_version": "1.2.3" - }, - "org.onap.domain.database.Local_K8SMicroserviceControlLoopElement": { - "name": "org.onap.domain.database.Local_K8SMicroserviceControlLoopElement", - "version": "1.2.3", - "derived_from": null, - "metadata": {}, - "description": "Control loop element for the K8S microservice for local chart", - "type": "org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement", - "type_version": "1.0.0", - "properties": { - "participant_id": { - "name": "K8sParticipant0", - "version": "1.0.0" - }, - "provider": "ONAP", - "chart": { - "chartId": { - "name": "nginx-ingress", - "version": "0.9.1" - }, - "releaseName": "nginxms", - "namespace": "test" - }, - "participantType": { - "name": "org.onap.k8s.controlloop.K8SControlLoopParticipant", - "version": "2.3.4" - } - }, - "requirements": null, - "capabilities": null, - "identifier": { - "name": "org.onap.domain.database.Local_K8SMicroserviceControlLoopElement", - "version": "1.2.3" - }, - "type_identifier": { - "name": "org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement", - "version": "1.0.0" - }, - "key": { - "name": "org.onap.domain.database.Local_K8SMicroserviceControlLoopElement", - "version": "1.2.3" - }, - "defined_name": "org.onap.domain.database.Local_K8SMicroserviceControlLoopElement", - "defined_version": "1.2.3" - }, - "org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement": { - "name": "org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement", - "version": "1.2.3", - "derived_from": null, - "metadata": {}, - "description": "Control loop element for the monitoring policy for Performance Management Subscription Handling", - "type": "org.onap.policy.clamp.controlloop.PolicyControlLoopElement", - "type_version": "1.0.0", - "properties": { - "participant_id": { - "name": "org.onap.PM_Policy", - "version": "1.0.0" - }, - "policy_type_id": { - "name": "onap.policies.monitoring.pm-subscription-handler", - "version": "1.0.0" - }, - "participantType": { - "name": "org.onap.policy.controlloop.PolicyControlLoopParticipant", - "version": "2.3.1" - }, - "provider": "Ericsson", - "policy_id": { - "get_input": "pmsh_monitoring_policy" - } - }, - "requirements": null, - "capabilities": null, - "identifier": { - "name": "org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement", - "version": "1.2.3" - }, - "type_identifier": { - "name": "org.onap.policy.clamp.controlloop.PolicyControlLoopElement", - "version": "1.0.0" - }, - "key": { - "name": "org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement", - "version": "1.2.3" - }, - "defined_name": "org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement", - "defined_version": "1.2.3" - }, - "org.onap.k8s.controlloop.K8SControlLoopParticipant": { - "name": "org.onap.k8s.controlloop.K8SControlLoopParticipant", - "version": "2.3.4", - "derived_from": null, - "metadata": {}, - "description": "Participant for K8S", - "type": "org.onap.policy.clamp.controlloop.Participant", - "type_version": "1.0.1", - "properties": { - "provider": "ONAP" - }, - "requirements": null, - "capabilities": null, - "identifier": { - "name": "org.onap.k8s.controlloop.K8SControlLoopParticipant", - "version": "2.3.4" - }, - "type_identifier": { - "name": "org.onap.policy.clamp.controlloop.Participant", - "version": "1.0.1" - }, - "key": { - "name": "org.onap.k8s.controlloop.K8SControlLoopParticipant", - "version": "2.3.4" - }, - "defined_name": "org.onap.k8s.controlloop.K8SControlLoopParticipant", - "defined_version": "2.3.4" - }, - "org.onap.domain.pmsh.DerivedDerivedPolicyControlLoopElement": { - "name": "org.onap.domain.pmsh.DerivedDerivedPolicyControlLoopElement", - "version": "1.2.3", - "derived_from": null, - "metadata": {}, - "description": "Control loop for Performance Management Subscription Handling", - "type": "org.onap.policy.clamp.controlloop.DerivedDerivedPolicyControlLoopElement", - "type_version": "1.0.0", - "properties": { - "participant_id": { - "name": "org.onap.PM_Policy", - "version": "1.0.0" - }, - "provider": "Ericsson", - "participantType": { - "name": "org.onap.policy.controlloop.PolicyControlLoopParticipant", - "version": "2.3.1" - } - }, - "requirements": null, - "capabilities": null, - "identifier": { - "name": "org.onap.domain.pmsh.DerivedDerivedPolicyControlLoopElement", - "version": "1.2.3" - }, - "type_identifier": { - "name": "org.onap.policy.clamp.controlloop.DerivedDerivedPolicyControlLoopElement", - "version": "1.0.0" - }, - "key": { - "name": "org.onap.domain.pmsh.DerivedDerivedPolicyControlLoopElement", - "version": "1.2.3" - }, - "defined_name": "org.onap.domain.pmsh.DerivedDerivedPolicyControlLoopElement", - "defined_version": "1.2.3" - }, - "org.onap.domain.sample.GenericK8s_ControlLoopDefinition": { - "name": "org.onap.domain.sample.GenericK8s_ControlLoopDefinition", - "version": "1.2.3", - "derived_from": null, - "metadata": {}, - "description": "Control loop for Hello World", - "type": "org.onap.policy.clamp.controlloop.ControlLoop", - "type_version": "1.0.0", - "properties": { - "elements": [ - { - "name": "org.onap.domain.database.PMSH_K8SMicroserviceControlLoopElement", - "version": "1.2.3" - }, - { - "name": "org.onap.domain.database.Local_K8SMicroserviceControlLoopElement", - "version": "1.2.3" - }, - { - "name": "org.onap.domain.database.Http_PMSHMicroserviceControlLoopElement", - "version": "1.2.3" - }, - { - "name": "org.onap.domain.pmsh.DerivedPolicyControlLoopElement", - "version": "1.2.3" - }, - { - "name": "org.onap.domain.pmsh.DerivedDerivedPolicyControlLoopElement", - "version": "1.2.3" - }, - { - "name": "org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement", - "version": "1.2.3" - }, - { - "name": "org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement", - "version": "1.2.3" - } - ], - "provider": "ONAP" - }, - "requirements": null, - "capabilities": null, - "identifier": { - "name": "org.onap.domain.sample.GenericK8s_ControlLoopDefinition", - "version": "1.2.3" - }, - "type_identifier": { - "name": "org.onap.policy.clamp.controlloop.ControlLoop", - "version": "1.0.0" - }, - "key": { - "name": "org.onap.domain.sample.GenericK8s_ControlLoopDefinition", - "version": "1.2.3" - }, - "defined_name": "org.onap.domain.sample.GenericK8s_ControlLoopDefinition", - "defined_version": "1.2.3" - }, - "org.onap.policy.controlloop.PolicyControlLoopParticipant": { - "name": "org.onap.policy.controlloop.PolicyControlLoopParticipant", - "version": "2.3.1", - "derived_from": null, - "metadata": {}, - "description": "Participant for DCAE microservices", - "type": "org.onap.policy.clamp.controlloop.Participant", - "type_version": "1.0.1", - "properties": { - "provider": "ONAP" - }, - "requirements": null, - "capabilities": null, - "identifier": { - "name": "org.onap.policy.controlloop.PolicyControlLoopParticipant", - "version": "2.3.1" - }, - "type_identifier": { - "name": "org.onap.policy.clamp.controlloop.Participant", - "version": "1.0.1" - }, - "key": { - "name": "org.onap.policy.controlloop.PolicyControlLoopParticipant", - "version": "2.3.1" - }, - "defined_name": "org.onap.policy.controlloop.PolicyControlLoopParticipant", - "defined_version": "2.3.1" - }, - "org.onap.domain.database.PMSH_K8SMicroserviceControlLoopElement": { - "name": "org.onap.domain.database.PMSH_K8SMicroserviceControlLoopElement", - "version": "1.2.3", - "derived_from": null, - "metadata": {}, - "description": "Control loop element for the K8S microservice for PMSH", - "type": "org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement", - "type_version": "1.0.0", - "properties": { - "participant_id": { - "name": "K8sParticipant0", - "version": "1.0.0" - }, - "provider": "ONAP", - "chart": { - "chartId": { - "name": "dcae-pmsh", - "version": "8.0.0" - }, - "namespace": "onap", - "releaseName": "pmshms", - "repository": { - "repoName": "chartmuseum", - "protocol": "http", - "address": "10.152.183.120", - "port": 80, - "userName": "onapinitializer", - "password": "demo123456!" - }, - "overrideParams": { - "global.masterPassword": "test" - } - }, - "participantType": { - "name": "org.onap.k8s.controlloop.K8SControlLoopParticipant", - "version": "2.3.4" - } - }, - "requirements": null, - "capabilities": null, - "identifier": { - "name": "org.onap.domain.database.PMSH_K8SMicroserviceControlLoopElement", - "version": "1.2.3" - }, - "type_identifier": { - "name": "org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement", - "version": "1.0.0" - }, - "key": { - "name": "org.onap.domain.database.PMSH_K8SMicroserviceControlLoopElement", - "version": "1.2.3" - }, - "defined_name": "org.onap.domain.database.PMSH_K8SMicroserviceControlLoopElement", - "defined_version": "1.2.3" - }, - "org.onap.domain.pmsh.DerivedPolicyControlLoopElement": { - "name": "org.onap.domain.pmsh.DerivedPolicyControlLoopElement", - "version": "1.2.3", - "derived_from": null, - "metadata": {}, - "description": "Control loop for Performance Management Subscription Handling", - "type": "org.onap.policy.clamp.controlloop.DerivedPolicyControlLoopElement", - "type_version": "1.0.0", - "properties": { - "participant_id": { - "name": "org.onap.PM_Policy", - "version": "1.0.0" - }, - "provider": "Ericsson", - "participantType": { - "name": "org.onap.policy.controlloop.PolicyControlLoopParticipant", - "version": "2.3.1" - } - }, - "requirements": null, - "capabilities": null, - "identifier": { - "name": "org.onap.domain.pmsh.DerivedPolicyControlLoopElement", - "version": "1.2.3" - }, - "type_identifier": { - "name": "org.onap.policy.clamp.controlloop.DerivedPolicyControlLoopElement", - "version": "1.0.0" - }, - "key": { - "name": "org.onap.domain.pmsh.DerivedPolicyControlLoopElement", - "version": "1.2.3" - }, - "defined_name": "org.onap.domain.pmsh.DerivedPolicyControlLoopElement", - "defined_version": "1.2.3" - } - }, - "policies": null, - "policies_as_map": {} - }, - "tosca_definitions_version": "tosca_simple_yaml_1_3", - "data_types": { - "onap.datatype.controlloop.Actor": { - "name": "onap.datatype.controlloop.Actor", - "version": "0.0.0", - "derived_from": "tosca.datatypes.Root", - "metadata": {}, - "description": "An actor/operation/target definition", - "properties": { - "payload": { - "name": "payload", - "type": "map", - "type_version": "0.0.0", - "description": "Name/value pairs of payload information passed by Policy to the actor", - "default_value": null, - "required": false, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": { - "name": null, - "type": "string", - "type_version": "0.0.0", - "description": null, - "constraints": null - }, - "metadata": { - "clamp_possible_values": "ClampExecution:CDS/payload" - } - }, - "target": { - "name": "target", - "type": "onap.datatype.controlloop.Target", - "type_version": "0.0.0", - "description": "The resource the operation should be performed on.", - "default_value": null, - "required": true, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "actor": { - "name": "actor", - "type": "string", - "type_version": "0.0.0", - "description": "The actor performing the operation.", - "default_value": null, - "required": true, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": { - "clamp_possible_values": "Dictionary:DefaultActors,ClampExecution:CDS/actor" - } - }, - "operation": { - "name": "operation", - "type": "string", - "type_version": "0.0.0", - "description": "The operation the actor is performing.", - "default_value": null, - "required": true, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": { - "clamp_possible_values": "Dictionary:DefaultOperations,ClampExecution:CDS/operation" - } - } - }, - "constraints": [], - "key": { - "name": "onap.datatype.controlloop.Actor", - "version": "0.0.0" - }, - "type": null, - "type_version": null, - "defined_name": "onap.datatype.controlloop.Actor", - "defined_version": null - }, - "onap.datatype.controlloop.Operation": { - "name": "onap.datatype.controlloop.Operation", - "version": "0.0.0", - "derived_from": "tosca.datatypes.Root", - "metadata": {}, - "description": "An operation supported by an actor", - "properties": { - "failure_retries": { - "name": "failure_retries", - "type": "string", - "type_version": "0.0.0", - "description": "Points to the operation to invoke when the current operation has exceeded its max retries.", - "default_value": "final_failure_retries", - "required": false, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "id": { - "name": "id", - "type": "string", - "type_version": "0.0.0", - "description": "Unique identifier for the operation", - "default_value": null, - "required": true, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "failure_timeout": { - "name": "failure_timeout", - "type": "string", - "type_version": "0.0.0", - "description": "Points to the operation to invoke when the time out for the operation occurs.", - "default_value": "final_failure_timeout", - "required": false, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "failure": { - "name": "failure", - "type": "string", - "type_version": "0.0.0", - "description": "Points to the operation to invoke on Actor operation failure.", - "default_value": "final_failure", - "required": false, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "operation": { - "name": "operation", - "type": "onap.datatype.controlloop.Actor", - "type_version": "0.0.0", - "description": "The definition of the operation to be performed.", - "default_value": null, - "required": true, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "failure_guard": { - "name": "failure_guard", - "type": "string", - "type_version": "0.0.0", - "description": "Points to the operation to invoke when the current operation is blocked due to guard policy enforcement.", - "default_value": "final_failure_guard", - "required": false, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "retries": { - "name": "retries", - "type": "integer", - "type_version": "0.0.0", - "description": "The number of retries the actor should attempt to perform the operation.", - "default_value": 0.0, - "required": true, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "timeout": { - "name": "timeout", - "type": "integer", - "type_version": "0.0.0", - "description": "The amount of time for the actor to perform the operation.", - "default_value": null, - "required": true, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "failure_exception": { - "name": "failure_exception", - "type": "string", - "type_version": "0.0.0", - "description": "Points to the operation to invoke when the current operation causes an exception.", - "default_value": "final_failure_exception", - "required": false, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "description": { - "name": "description", - "type": "string", - "type_version": "0.0.0", - "description": "A user-friendly description of the intent for the operation", - "default_value": null, - "required": false, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "success": { - "name": "success", - "type": "string", - "type_version": "0.0.0", - "description": "Points to the operation to invoke on success. A value of \"final_success\" indicates and end to the operation.", - "default_value": "final_success", - "required": false, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - } - }, - "constraints": [], - "key": { - "name": "onap.datatype.controlloop.Operation", - "version": "0.0.0" - }, - "type": null, - "type_version": null, - "defined_name": "onap.datatype.controlloop.Operation", - "defined_version": null - }, - "onap.datatype.controlloop.Target": { - "name": "onap.datatype.controlloop.Target", - "version": "0.0.0", - "derived_from": "tosca.datatypes.Root", - "metadata": {}, - "description": "Definition for a entity in A&AI to perform a control loop operation on", - "properties": { - "entityIds": { - "name": "entityIds", - "type": "map", - "type_version": "0.0.0", - "description": "Map of values that identify the resource. If none are provided, it is assumed that the\nentity that generated the ONSET event will be the target.\n", - "default_value": null, - "required": false, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": { - "name": null, - "type": "string", - "type_version": "0.0.0", - "description": null, - "constraints": null - }, - "metadata": { - "clamp_possible_values": "ClampExecution:CSAR_RESOURCES" - } - }, - "targetType": { - "name": "targetType", - "type": "string", - "type_version": "0.0.0", - "description": "Category for the target type", - "default_value": null, - "required": true, - "status": null, - "constraints": [ - { - "valid_values": [ - "VNF", - "VM", - "VFMODULE", - "PNF" - ], - "equal": null, - "greater_than": null, - "greater_or_equal": null, - "less_than": null, - "less_or_equal": null, - "range_values": null - } - ], - "key_schema": null, - "entry_schema": null, - "metadata": null - } - }, - "constraints": [], - "key": { - "name": "onap.datatype.controlloop.Target", - "version": "0.0.0" - }, - "type": null, - "type_version": null, - "defined_name": "onap.datatype.controlloop.Target", - "defined_version": null - }, - "onap.datatypes.ToscaConceptIdentifier": { - "name": "onap.datatypes.ToscaConceptIdentifier", - "version": "0.0.0", - "derived_from": "tosca.datatypes.Root", - "metadata": {}, - "description": null, - "properties": { - "version": { - "name": "version", - "type": "string", - "type_version": "0.0.0", - "description": null, - "default_value": null, - "required": true, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "name": { - "name": "name", - "type": "string", - "type_version": "0.0.0", - "description": null, - "default_value": null, - "required": true, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - } - }, - "constraints": [], - "key": { - "name": "onap.datatypes.ToscaConceptIdentifier", - "version": "0.0.0" - }, - "type": null, - "type_version": null, - "defined_name": "onap.datatypes.ToscaConceptIdentifier", - "defined_version": null - }, - "onap.datatypes.monitoring.managedObjectDNsBasic": { - "name": "onap.datatypes.monitoring.managedObjectDNsBasic", - "version": "0.0.0", - "derived_from": "tosca.datatypes.Root", - "metadata": {}, - "description": null, - "properties": { - "DN": { - "name": "DN", - "type": "string", - "type_version": "0.0.0", - "description": "Managed object distinguished name", - "default_value": null, - "required": true, - "status": null, - "constraints": [], - "key_schema": null, - "entry_schema": null, - "metadata": {} - } - }, - "constraints": [], - "key": { - "name": "onap.datatypes.monitoring.managedObjectDNsBasic", - "version": "0.0.0" - }, - "type": null, - "type_version": null, - "defined_name": "onap.datatypes.monitoring.managedObjectDNsBasic", - "defined_version": null - }, - "onap.datatypes.monitoring.managedObjectDNsBasics": { - "name": "onap.datatypes.monitoring.managedObjectDNsBasics", - "version": "0.0.0", - "derived_from": "tosca.datatypes.Root", - "metadata": {}, - "description": null, - "properties": { - "managedObjectDNsBasic": { - "name": "managedObjectDNsBasic", - "type": "map", - "type_version": "0.0.0", - "description": "Managed object distinguished name object", - "default_value": null, - "required": true, - "status": null, - "constraints": [], - "key_schema": null, - "entry_schema": { - "name": null, - "type": "onap.datatypes.monitoring.managedObjectDNsBasic", - "type_version": "0.0.0", - "description": null, - "constraints": [] - }, - "metadata": {} - } - }, - "constraints": [], - "key": { - "name": "onap.datatypes.monitoring.managedObjectDNsBasics", - "version": "0.0.0" - }, - "type": null, - "type_version": null, - "defined_name": "onap.datatypes.monitoring.managedObjectDNsBasics", - "defined_version": null - }, - "onap.datatypes.monitoring.measurementGroup": { - "name": "onap.datatypes.monitoring.measurementGroup", - "version": "0.0.0", - "derived_from": "tosca.datatypes.Root", - "metadata": {}, - "description": null, - "properties": { - "measurementTypes": { - "name": "measurementTypes", - "type": "list", - "type_version": "0.0.0", - "description": "List of measurement types", - "default_value": null, - "required": true, - "status": null, - "constraints": [], - "key_schema": null, - "entry_schema": { - "name": null, - "type": "onap.datatypes.monitoring.measurementTypes", - "type_version": "0.0.0", - "description": null, - "constraints": [] - }, - "metadata": {} - }, - "managedObjectDNsBasic": { - "name": "managedObjectDNsBasic", - "type": "list", - "type_version": "0.0.0", - "description": "List of managed object distinguished names", - "default_value": null, - "required": true, - "status": null, - "constraints": [], - "key_schema": null, - "entry_schema": { - "name": null, - "type": "onap.datatypes.monitoring.managedObjectDNsBasics", - "type_version": "0.0.0", - "description": null, - "constraints": [] - }, - "metadata": {} - } - }, - "constraints": [], - "key": { - "name": "onap.datatypes.monitoring.measurementGroup", - "version": "0.0.0" - }, - "type": null, - "type_version": null, - "defined_name": "onap.datatypes.monitoring.measurementGroup", - "defined_version": null - }, - "onap.datatypes.monitoring.measurementGroups": { - "name": "onap.datatypes.monitoring.measurementGroups", - "version": "0.0.0", - "derived_from": "tosca.datatypes.Root", - "metadata": {}, - "description": null, - "properties": { - "measurementGroup": { - "name": "measurementGroup", - "type": "map", - "type_version": "0.0.0", - "description": "Measurement Group", - "default_value": null, - "required": true, - "status": null, - "constraints": [], - "key_schema": null, - "entry_schema": { - "name": null, - "type": "onap.datatypes.monitoring.measurementGroup", - "type_version": "0.0.0", - "description": null, - "constraints": [] - }, - "metadata": {} - } - }, - "constraints": [], - "key": { - "name": "onap.datatypes.monitoring.measurementGroups", - "version": "0.0.0" - }, - "type": null, - "type_version": null, - "defined_name": "onap.datatypes.monitoring.measurementGroups", - "defined_version": null - }, - "onap.datatypes.monitoring.measurementType": { - "name": "onap.datatypes.monitoring.measurementType", - "version": "0.0.0", - "derived_from": "tosca.datatypes.Root", - "metadata": {}, - "description": null, - "properties": { - "measurementType": { - "name": "measurementType", - "type": "string", - "type_version": "0.0.0", - "description": "Measurement type", - "default_value": null, - "required": true, - "status": null, - "constraints": [], - "key_schema": null, - "entry_schema": null, - "metadata": {} - } - }, - "constraints": [], - "key": { - "name": "onap.datatypes.monitoring.measurementType", - "version": "0.0.0" - }, - "type": null, - "type_version": null, - "defined_name": "onap.datatypes.monitoring.measurementType", - "defined_version": null - }, - "onap.datatypes.monitoring.measurementTypes": { - "name": "onap.datatypes.monitoring.measurementTypes", - "version": "0.0.0", - "derived_from": "tosca.datatypes.Root", - "metadata": {}, - "description": null, - "properties": { - "measurementType": { - "name": "measurementType", - "type": "map", - "type_version": "0.0.0", - "description": "Measurement type object", - "default_value": null, - "required": true, - "status": null, - "constraints": [], - "key_schema": null, - "entry_schema": { - "name": null, - "type": "onap.datatypes.monitoring.measurementType", - "type_version": "0.0.0", - "description": null, - "constraints": [] - }, - "metadata": {} - } - }, - "constraints": [], - "key": { - "name": "onap.datatypes.monitoring.measurementTypes", - "version": "0.0.0" - }, - "type": null, - "type_version": null, - "defined_name": "onap.datatypes.monitoring.measurementTypes", - "defined_version": null - }, - "onap.datatypes.monitoring.nfFilter": { - "name": "onap.datatypes.monitoring.nfFilter", - "version": "0.0.0", - "derived_from": "tosca.datatypes.Root", - "metadata": {}, - "description": null, - "properties": { - "modelVersionIDs": { - "name": "modelVersionIDs", - "type": "list", - "type_version": "0.0.0", - "description": "List of model version IDs", - "default_value": null, - "required": true, - "status": null, - "constraints": [], - "key_schema": null, - "entry_schema": { - "name": null, - "type": "string", - "type_version": "0.0.0", - "description": null, - "constraints": [] - }, - "metadata": {} - }, - "modelInvariantIDs": { - "name": "modelInvariantIDs", - "type": "list", - "type_version": "0.0.0", - "description": "List of model invariant IDs", - "default_value": null, - "required": true, - "status": null, - "constraints": [], - "key_schema": null, - "entry_schema": { - "name": null, - "type": "string", - "type_version": "0.0.0", - "description": null, - "constraints": [] - }, - "metadata": {} - }, - "modelNames": { - "name": "modelNames", - "type": "list", - "type_version": "0.0.0", - "description": "List of model names", - "default_value": null, - "required": true, - "status": null, - "constraints": [], - "key_schema": null, - "entry_schema": { - "name": null, - "type": "string", - "type_version": "0.0.0", - "description": null, - "constraints": [] - }, - "metadata": {} - }, - "nfNames": { - "name": "nfNames", - "type": "list", - "type_version": "0.0.0", - "description": "List of network functions", - "default_value": null, - "required": true, - "status": null, - "constraints": [], - "key_schema": null, - "entry_schema": { - "name": null, - "type": "string", - "type_version": "0.0.0", - "description": null, - "constraints": [] - }, - "metadata": {} - } - }, - "constraints": [], - "key": { - "name": "onap.datatypes.monitoring.nfFilter", - "version": "0.0.0" - }, - "type": null, - "type_version": null, - "defined_name": "onap.datatypes.monitoring.nfFilter", - "defined_version": null - }, - "onap.datatypes.monitoring.subscription": { - "name": "onap.datatypes.monitoring.subscription", - "version": "0.0.0", - "derived_from": "tosca.datatypes.Root", - "metadata": {}, - "description": null, - "properties": { - "measurementGroups": { - "name": "measurementGroups", - "type": "list", - "type_version": "0.0.0", - "description": "Measurement Groups", - "default_value": null, - "required": true, - "status": null, - "constraints": [], - "key_schema": null, - "entry_schema": { - "name": null, - "type": "onap.datatypes.monitoring.measurementGroups", - "type_version": "0.0.0", - "description": null, - "constraints": [] - }, - "metadata": {} - }, - "fileBasedGP": { - "name": "fileBasedGP", - "type": "integer", - "type_version": "0.0.0", - "description": "File based granularity period", - "default_value": null, - "required": true, - "status": null, - "constraints": [], - "key_schema": null, - "entry_schema": null, - "metadata": {} - }, - "fileLocation": { - "name": "fileLocation", - "type": "string", - "type_version": "0.0.0", - "description": "ROP file location", - "default_value": null, - "required": true, - "status": null, - "constraints": [], - "key_schema": null, - "entry_schema": null, - "metadata": {} - }, - "subscriptionName": { - "name": "subscriptionName", - "type": "string", - "type_version": "0.0.0", - "description": "Name of the subscription", - "default_value": null, - "required": true, - "status": null, - "constraints": [], - "key_schema": null, - "entry_schema": null, - "metadata": {} - }, - "administrativeState": { - "name": "administrativeState", - "type": "string", - "type_version": "0.0.0", - "description": "State of the subscription", - "default_value": null, - "required": true, - "status": null, - "constraints": [ - { - "valid_values": [ - "LOCKED", - "UNLOCKED" - ], - "equal": null, - "greater_than": null, - "greater_or_equal": null, - "less_than": null, - "less_or_equal": null, - "range_values": null - } - ], - "key_schema": null, - "entry_schema": null, - "metadata": {} - }, - "nfFilter": { - "name": "nfFilter", - "type": "map", - "type_version": "0.0.0", - "description": "Network function filter", - "default_value": null, - "required": true, - "status": null, - "constraints": [], - "key_schema": null, - "entry_schema": { - "name": null, - "type": "onap.datatypes.monitoring.nfFilter", - "type_version": "0.0.0", - "description": null, - "constraints": [] - }, - "metadata": {} - } - }, - "constraints": [], - "key": { - "name": "onap.datatypes.monitoring.subscription", - "version": "0.0.0" - }, - "type": null, - "type_version": null, - "defined_name": "onap.datatypes.monitoring.subscription", - "defined_version": null - }, - "org.onap.datatypes.policy.clamp.controlloop.httpControlLoopElement.RestRequest": { - "name": "org.onap.datatypes.policy.clamp.controlloop.httpControlLoopElement.RestRequest", - "version": "1.0.0", - "derived_from": "tosca.datatypes.Root", - "metadata": {}, - "description": null, - "properties": { - "body": { - "name": "body", - "type": "string", - "type_version": "0.0.0", - "description": "The body of the REST request for PUT and POST requests", - "default_value": null, - "required": false, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "expectedResponse": { - "name": "expectedResponse", - "type": "integer", - "type_version": "0.0.0", - "description": "THe expected HTTP status code for the REST request", - "default_value": null, - "required": true, - "status": null, - "constraints": [], - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "httpMethod": { - "name": "httpMethod", - "type": "string", - "type_version": "0.0.0", - "description": "The REST method to use", - "default_value": null, - "required": true, - "status": null, - "constraints": [ - { - "valid_values": [ - "POST", - "PUT", - "GET", - "DELETE" - ], - "equal": null, - "greater_than": null, - "greater_or_equal": null, - "less_than": null, - "less_or_equal": null, - "range_values": null - } - ], - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "restRequestId": { - "name": "restRequestId", - "type": "onap.datatypes.ToscaConceptIdentifier", - "type_version": "0.0.0", - "description": "The name and version of a REST request to be sent to a REST endpoint", - "default_value": null, - "required": true, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - }, - "path": { - "name": "path", - "type": "string", - "type_version": "0.0.0", - "description": "The path of the REST request relative to the base URL", - "default_value": null, - "required": true, - "status": null, - "constraints": null, - "key_schema": null, - "entry_schema": null, - "metadata": null - } - }, - "constraints": [], - "key": { - "name": "org.onap.datatypes.policy.clamp.controlloop.httpControlLoopElement.RestRequest", - "version": "1.0.0" - }, - "type": null, - "type_version": null, - "defined_name": "org.onap.datatypes.policy.clamp.controlloop.httpControlLoopElement.RestRequest", - "defined_version": "1.0.0" - } - } -} diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/testFiles/instanceProps.json b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/testFiles/instanceProps.json deleted file mode 100644 index b8250fd..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/testFiles/instanceProps.json +++ /dev/null @@ -1,1444 +0,0 @@ -{ - "org.onap.domain.database.Http_PMSHMicroserviceControlLoopElement": { - "name": "org.onap.domain.database.Http_PMSHMicroserviceControlLoopElement", - "version": "1.2.3", - "derivedFrom": null, - "metadata": {}, - "description": "Control loop element for the http requests of PMSH microservice", - "type": "org.onap.policy.clamp.controlloop.HttpControlLoopElement", - "typeVersion": "1.0.1", - "properties": { - "provider": { - "name": "provider", - "type": "string", - "typeVersion": "0.0.0", - "description": "Specifies the organization that provides the control loop element", - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "passiveToUninitializedTimeout": { - "name": "passiveToUninitializedTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to uninitialized", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "participant_id": { - "name": "participant_id", - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": null, - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "participantType": { - "name": "participantType", - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": "The identity of the participant type that hosts this type of Control Loop Element", - "defaultValue": null, - "required": true, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "uninitializedToPassiveTimeout": { - "name": "uninitializedToPassiveTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from uninitialized to passive", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "startPhase": { - "name": "startPhase", - "type": "integer", - "typeVersion": "0.0.0", - "description": "A value indicating the start phase in which this control loop element will be started, the first start phase is zero. Control Loop Elements are started in their start_phase order and stopped in reverse start phase order. Control Loop Elements with the same start phase are started and stopped simultaneously", - "defaultValue": null, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "runningToPassiveTimeout": { - "name": "runningToPassiveTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from running to passive", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "passiveToRunningTimeout": { - "name": "passiveToRunningTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to running", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - } - }, - "requirements": null, - "capabilities": null, - "identifier": { - "name": "org.onap.domain.database.Http_PMSHMicroserviceControlLoopElement", - "version": "1.2.3" - }, - "typeIdentifier": { - "name": "org.onap.policy.clamp.controlloop.HttpControlLoopElement", - "version": "1.0.1" - }, - "key": { - "name": "org.onap.domain.database.Http_PMSHMicroserviceControlLoopElement", - "version": "1.2.3" - }, - "definedName": "org.onap.domain.database.Http_PMSHMicroserviceControlLoopElement", - "definedVersion": "1.2.3" - }, - "org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement": { - "name": "org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement", - "version": "1.2.3", - "derivedFrom": null, - "metadata": {}, - "description": "Control loop element for the operational policy for Performance Management Subscription Handling", - "type": "org.onap.policy.clamp.controlloop.PolicyControlLoopElement", - "typeVersion": "1.0.0", - "properties": { - "provider": { - "name": "provider", - "type": "string", - "typeVersion": "0.0.0", - "description": "Specifies the organization that provides the control loop element", - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "passiveToUninitializedTimeout": { - "name": "passiveToUninitializedTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to uninitialized", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "participant_id": { - "name": "participant_id", - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": null, - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "participantType": { - "name": "participantType", - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": "The identity of the participant type that hosts this type of Control Loop Element", - "defaultValue": null, - "required": true, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "uninitializedToPassiveTimeout": { - "name": "uninitializedToPassiveTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from uninitialized to passive", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "startPhase": { - "name": "startPhase", - "type": "integer", - "typeVersion": "0.0.0", - "description": "A value indicating the start phase in which this control loop element will be started, the first start phase is zero. Control Loop Elements are started in their start_phase order and stopped in reverse start phase order. Control Loop Elements with the same start phase are started and stopped simultaneously", - "defaultValue": null, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "runningToPassiveTimeout": { - "name": "runningToPassiveTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from running to passive", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "passiveToRunningTimeout": { - "name": "passiveToRunningTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to running", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - } - }, - "requirements": null, - "capabilities": null, - "identifier": { - "name": "org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement", - "version": "1.2.3" - }, - "typeIdentifier": { - "name": "org.onap.policy.clamp.controlloop.PolicyControlLoopElement", - "version": "1.0.0" - }, - "key": { - "name": "org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement", - "version": "1.2.3" - }, - "definedName": "org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement", - "definedVersion": "1.2.3" - }, - "org.onap.domain.database.Local_K8SMicroserviceControlLoopElement": { - "name": "org.onap.domain.database.Local_K8SMicroserviceControlLoopElement", - "version": "1.2.3", - "derivedFrom": null, - "metadata": {}, - "description": "Control loop element for the K8S microservice for local chart", - "type": "org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement", - "typeVersion": "1.0.0", - "properties": { - "provider": { - "name": "provider", - "type": "string", - "typeVersion": "0.0.0", - "description": "Specifies the organization that provides the control loop element", - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "passiveToUninitializedTimeout": { - "name": "passiveToUninitializedTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to uninitialized", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "participant_id": { - "name": "participant_id", - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": null, - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "participantType": { - "name": "participantType", - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": "The identity of the participant type that hosts this type of Control Loop Element", - "defaultValue": null, - "required": true, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "uninitializedToPassiveTimeout": { - "name": "uninitializedToPassiveTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from uninitialized to passive", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "startPhase": { - "name": "startPhase", - "type": "integer", - "typeVersion": "0.0.0", - "description": "A value indicating the start phase in which this control loop element will be started, the first start phase is zero. Control Loop Elements are started in their start_phase order and stopped in reverse start phase order. Control Loop Elements with the same start phase are started and stopped simultaneously", - "defaultValue": null, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "runningToPassiveTimeout": { - "name": "runningToPassiveTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from running to passive", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "passiveToRunningTimeout": { - "name": "passiveToRunningTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to running", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - } - }, - "requirements": null, - "capabilities": null, - "identifier": { - "name": "org.onap.domain.database.Local_K8SMicroserviceControlLoopElement", - "version": "1.2.3" - }, - "typeIdentifier": { - "name": "org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement", - "version": "1.0.0" - }, - "key": { - "name": "org.onap.domain.database.Local_K8SMicroserviceControlLoopElement", - "version": "1.2.3" - }, - "definedName": "org.onap.domain.database.Local_K8SMicroserviceControlLoopElement", - "definedVersion": "1.2.3" - }, - "org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement": { - "name": "org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement", - "version": "1.2.3", - "derivedFrom": null, - "metadata": {}, - "description": "Control loop element for the monitoring policy for Performance Management Subscription Handling", - "type": "org.onap.policy.clamp.controlloop.PolicyControlLoopElement", - "typeVersion": "1.0.0", - "properties": { - "provider": { - "name": "provider", - "type": "string", - "typeVersion": "0.0.0", - "description": "Specifies the organization that provides the control loop element", - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "passiveToUninitializedTimeout": { - "name": "passiveToUninitializedTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to uninitialized", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "participant_id": { - "name": "participant_id", - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": null, - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "participantType": { - "name": "participantType", - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": "The identity of the participant type that hosts this type of Control Loop Element", - "defaultValue": null, - "required": true, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "uninitializedToPassiveTimeout": { - "name": "uninitializedToPassiveTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from uninitialized to passive", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "startPhase": { - "name": "startPhase", - "type": "integer", - "typeVersion": "0.0.0", - "description": "A value indicating the start phase in which this control loop element will be started, the first start phase is zero. Control Loop Elements are started in their start_phase order and stopped in reverse start phase order. Control Loop Elements with the same start phase are started and stopped simultaneously", - "defaultValue": null, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "runningToPassiveTimeout": { - "name": "runningToPassiveTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from running to passive", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "passiveToRunningTimeout": { - "name": "passiveToRunningTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to running", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - } - }, - "requirements": null, - "capabilities": null, - "identifier": { - "name": "org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement", - "version": "1.2.3" - }, - "typeIdentifier": { - "name": "org.onap.policy.clamp.controlloop.PolicyControlLoopElement", - "version": "1.0.0" - }, - "key": { - "name": "org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement", - "version": "1.2.3" - }, - "definedName": "org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement", - "definedVersion": "1.2.3" - }, - "org.onap.domain.pmsh.DerivedDerivedPolicyControlLoopElement": { - "name": "org.onap.domain.pmsh.DerivedDerivedPolicyControlLoopElement", - "version": "1.2.3", - "derivedFrom": null, - "metadata": {}, - "description": "Control loop for Performance Management Subscription Handling", - "type": "org.onap.policy.clamp.controlloop.DerivedDerivedPolicyControlLoopElement", - "typeVersion": "1.0.0", - "properties": { - "provider": { - "name": "provider", - "type": "string", - "typeVersion": "0.0.0", - "description": "Specifies the organization that provides the control loop element", - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "passiveToUninitializedTimeout": { - "name": "passiveToUninitializedTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to uninitialized", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "participant_id": { - "name": "participant_id", - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": null, - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "participantType": { - "name": "participantType", - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": "The identity of the participant type that hosts this type of Control Loop Element", - "defaultValue": null, - "required": true, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "uninitializedToPassiveTimeout": { - "name": "uninitializedToPassiveTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from uninitialized to passive", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "startPhase": { - "name": "startPhase", - "type": "integer", - "typeVersion": "0.0.0", - "description": "A value indicating the start phase in which this control loop element will be started, the first start phase is zero. Control Loop Elements are started in their start_phase order and stopped in reverse start phase order. Control Loop Elements with the same start phase are started and stopped simultaneously", - "defaultValue": null, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "runningToPassiveTimeout": { - "name": "runningToPassiveTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from running to passive", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "passiveToRunningTimeout": { - "name": "passiveToRunningTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to running", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - } - }, - "requirements": null, - "capabilities": null, - "identifier": { - "name": "org.onap.domain.pmsh.DerivedDerivedPolicyControlLoopElement", - "version": "1.2.3" - }, - "typeIdentifier": { - "name": "org.onap.policy.clamp.controlloop.DerivedDerivedPolicyControlLoopElement", - "version": "1.0.0" - }, - "key": { - "name": "org.onap.domain.pmsh.DerivedDerivedPolicyControlLoopElement", - "version": "1.2.3" - }, - "definedName": "org.onap.domain.pmsh.DerivedDerivedPolicyControlLoopElement", - "definedVersion": "1.2.3" - }, - "org.onap.domain.sample.GenericK8s_ControlLoopDefinition": { - "name": "org.onap.domain.sample.GenericK8s_ControlLoopDefinition", - "version": "1.2.3", - "derivedFrom": null, - "metadata": {}, - "description": "Control loop for Hello World", - "type": "org.onap.policy.clamp.controlloop.ControlLoop", - "typeVersion": "1.0.0", - "properties": { - "provider": { - "name": "provider", - "type": "string", - "typeVersion": "0.0.0", - "description": "Specifies the organization that provides the control loop element", - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "elements": { - "name": "elements", - "type": "list", - "typeVersion": "0.0.0", - "description": "Specifies a list of control loop element definitions that make up this control loop definition", - "defaultValue": null, - "required": true, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": { - "name": null, - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": null, - "constraints": null - }, - "metadata": { - "common": "false" - } - } - }, - "requirements": null, - "capabilities": null, - "identifier": { - "name": "org.onap.domain.sample.GenericK8s_ControlLoopDefinition", - "version": "1.2.3" - }, - "typeIdentifier": { - "name": "org.onap.policy.clamp.controlloop.ControlLoop", - "version": "1.0.0" - }, - "key": { - "name": "org.onap.domain.sample.GenericK8s_ControlLoopDefinition", - "version": "1.2.3" - }, - "definedName": "org.onap.domain.sample.GenericK8s_ControlLoopDefinition", - "definedVersion": "1.2.3" - }, - "org.onap.domain.database.PMSH_K8SMicroserviceControlLoopElement": { - "name": "org.onap.domain.database.PMSH_K8SMicroserviceControlLoopElement", - "version": "1.2.3", - "derivedFrom": null, - "metadata": {}, - "description": "Control loop element for the K8S microservice for PMSH", - "type": "org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement", - "typeVersion": "1.0.0", - "properties": { - "provider": { - "name": "provider", - "type": "string", - "typeVersion": "0.0.0", - "description": "Specifies the organization that provides the control loop element", - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "passiveToUninitializedTimeout": { - "name": "passiveToUninitializedTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to uninitialized", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "participant_id": { - "name": "participant_id", - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": null, - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "participantType": { - "name": "participantType", - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": "The identity of the participant type that hosts this type of Control Loop Element", - "defaultValue": null, - "required": true, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "uninitializedToPassiveTimeout": { - "name": "uninitializedToPassiveTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from uninitialized to passive", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "startPhase": { - "name": "startPhase", - "type": "integer", - "typeVersion": "0.0.0", - "description": "A value indicating the start phase in which this control loop element will be started, the first start phase is zero. Control Loop Elements are started in their start_phase order and stopped in reverse start phase order. Control Loop Elements with the same start phase are started and stopped simultaneously", - "defaultValue": null, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "runningToPassiveTimeout": { - "name": "runningToPassiveTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from running to passive", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "passiveToRunningTimeout": { - "name": "passiveToRunningTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to running", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - } - }, - "requirements": null, - "capabilities": null, - "identifier": { - "name": "org.onap.domain.database.PMSH_K8SMicroserviceControlLoopElement", - "version": "1.2.3" - }, - "typeIdentifier": { - "name": "org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement", - "version": "1.0.0" - }, - "key": { - "name": "org.onap.domain.database.PMSH_K8SMicroserviceControlLoopElement", - "version": "1.2.3" - }, - "definedName": "org.onap.domain.database.PMSH_K8SMicroserviceControlLoopElement", - "definedVersion": "1.2.3" - }, - "org.onap.domain.pmsh.DerivedPolicyControlLoopElement": { - "name": "org.onap.domain.pmsh.DerivedPolicyControlLoopElement", - "version": "1.2.3", - "derivedFrom": null, - "metadata": {}, - "description": "Control loop for Performance Management Subscription Handling", - "type": "org.onap.policy.clamp.controlloop.DerivedPolicyControlLoopElement", - "typeVersion": "1.0.0", - "properties": { - "provider": { - "name": "provider", - "type": "string", - "typeVersion": "0.0.0", - "description": "Specifies the organization that provides the control loop element", - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "passiveToUninitializedTimeout": { - "name": "passiveToUninitializedTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to uninitialized", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "participant_id": { - "name": "participant_id", - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": null, - "defaultValue": null, - "required": false, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "participantType": { - "name": "participantType", - "type": "onap.datatypes.ToscaConceptIdentifier", - "typeVersion": "0.0.0", - "description": "The identity of the participant type that hosts this type of Control Loop Element", - "defaultValue": null, - "required": true, - "status": null, - "constraints": null, - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "uninitializedToPassiveTimeout": { - "name": "uninitializedToPassiveTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from uninitialized to passive", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "startPhase": { - "name": "startPhase", - "type": "integer", - "typeVersion": "0.0.0", - "description": "A value indicating the start phase in which this control loop element will be started, the first start phase is zero. Control Loop Elements are started in their start_phase order and stopped in reverse start phase order. Control Loop Elements with the same start phase are started and stopped simultaneously", - "defaultValue": null, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "runningToPassiveTimeout": { - "name": "runningToPassiveTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from running to passive", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - }, - "passiveToRunningTimeout": { - "name": "passiveToRunningTimeout", - "type": "integer", - "typeVersion": "0.0.0", - "description": "The maximum time in seconds to wait for a state chage from passive to running", - "defaultValue": 60.0, - "required": false, - "status": null, - "constraints": [ - { - "validValues": null, - "equal": null, - "greaterThan": null, - "greaterOrEqual": "0", - "lessThan": null, - "lessOrEqual": null, - "rangeValues": null - } - ], - "keySchema": null, - "entrySchema": null, - "metadata": { - "common": "false" - } - } - }, - "requirements": null, - "capabilities": null, - "identifier": { - "name": "org.onap.domain.pmsh.DerivedPolicyControlLoopElement", - "version": "1.2.3" - }, - "typeIdentifier": { - "name": "org.onap.policy.clamp.controlloop.DerivedPolicyControlLoopElement", - "version": "1.0.0" - }, - "key": { - "name": "org.onap.domain.pmsh.DerivedPolicyControlLoopElement", - "version": "1.2.3" - }, - "definedName": "org.onap.domain.pmsh.DerivedPolicyControlLoopElement", - "definedVersion": "1.2.3" - } -} diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/testFiles/jsonEditorData.json b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/testFiles/jsonEditorData.json deleted file mode 100644 index c09424f..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/testFiles/jsonEditorData.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "__data": [ - "Object" - ], - "copyClipboard": null, - "editors": [ - "Object" - ], - "element": "<div … />", - "expandRefs": [ - "Function anonymous" - ], - "expandSchema": [ - "Function anonymous" - ], - "iconlib": [ - "n" - ], - "options": [ - "Object" - ], - "ready": true, - "refs": [ - "Object" - ], - "root": [ - "o" - ], - "root_container": "<div … />", - "schema": [ - "Object" - ], - "template": "undefined", - "theme": [ - "o" - ], - "translate": [ - "Function translate" - ], - "translateProperty": [ - "Function translateProperty" - ], - "uuid": 0, - "validation_results": [ - "Array" - ], - "validator": [ - "t" - ] -} diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/testFiles/orderedStateJson.json b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/testFiles/orderedStateJson.json deleted file mode 100644 index 91c892d..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/testFiles/orderedStateJson.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "orderedState": "PASSIVE", - "controlLoopIdentifierList": [ - { - "name": "PMSH_Instance1", - "version": "2.3.1" - } - ] -} diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/utils/CommissioningUtils.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/utils/CommissioningUtils.js deleted file mode 100644 index 2d98598..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/utils/CommissioningUtils.js +++ /dev/null @@ -1,178 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -import { JSONEditor } from "@json-editor/json-editor"; -import { Alert } from "react-bootstrap"; -import React from "react"; - -const CommissioningUtils = { - makeSchemaForCommonProperties: (commonProps) => { - const commonPropsArr = Object.entries(commonProps) - - const newSchemaObject = {} - - newSchemaObject.title = "CommonProperties" - newSchemaObject.type = "object" - newSchemaObject.properties = {} - - commonPropsArr.forEach(([templateKey, template]) => { - - const propertiesObject = {} - Object.entries(template.properties).forEach(([propKey, prop]) => { - - propertiesObject[propKey] = { - type: CommissioningUtils.getType(prop.type) - } - - }) - newSchemaObject.properties[templateKey] = { - options: { - "collapsed": true - }, - properties: propertiesObject - } - }) - - return newSchemaObject - }, - getType: (propertyType) => { - switch (propertyType) - { - case "string": - return "string" - case "integer": - return "integer" - case "list": - return "array" - case "object": - return "object" - default: - return "object" - } - }, - createJsonEditor: (toscaModel, editorData) => { - JSONEditor.defaults.options.collapse = false; - - return new JSONEditor(document.getElementById("editor"), - { - schema: toscaModel, - startval: editorData, - theme: 'bootstrap4', - iconlib: 'fontawesome5', - object_layout: 'normal', - disable_properties: false, - disable_edit_json: true, - disable_array_reorder: true, - disable_array_delete_last_row: true, - disable_array_delete_all_rows: false, - array_controls_top: true, - keep_oneof_values: false, - collapsed: false, - show_errors: 'always', - display_required_only: false, - show_opt_in: false, - prompt_before_delete: true, - required_by_default: false, - }) - }, - renderJsonEditor: async (template, commonProps) => { - - const fullTemplate = await template.json() - - let toscaInitialValues - const allNodeTemplates = fullTemplate.topology_template.node_templates - const shortenedNodeTemplatesObjectStartValues = {} - // Get the common properties to construct a schema - // Get valid start values at the same time - const commonNodeTemplatesJson = await commonProps.json().then(data => { - const nodeTemplatesArray = Object.entries(data) - const shortenedNodeTemplatesObject = {} - nodeTemplatesArray.forEach(([key, temp]) => { - const currentNodeTemplate = allNodeTemplates[key] - const propertiesObject = { - properties: temp.properties - } - - shortenedNodeTemplatesObject[key] = propertiesObject - - const propertiesStartValues = {} - - // Get all the existing start values to populate the properties in the schema - Object.entries(propertiesObject.properties).forEach(([propKey, prop]) => { - propertiesStartValues[propKey] = currentNodeTemplate.properties[propKey] - }) - - shortenedNodeTemplatesObjectStartValues[key] = propertiesStartValues - - }) - - toscaInitialValues = shortenedNodeTemplatesObjectStartValues; - return shortenedNodeTemplatesObject; - }) - - const propertySchema = CommissioningUtils.makeSchemaForCommonProperties(commonNodeTemplatesJson); - - const editorTemp = CommissioningUtils.createJsonEditor(propertySchema, shortenedNodeTemplatesObjectStartValues); - - return { - fullTemplate: fullTemplate, - propertySchema: propertySchema, - editorTemp: editorTemp, - toscaInitialValues: toscaInitialValues - } - }, - getAlertMessages: async (response) => { - if (response.ok) { - return(<Alert variant="success"> - <Alert.Heading>Commissioning Success</Alert.Heading> - <p>Altered Template was Successfully Uploaded</p> - <hr/> - </Alert>); - } - else { - return(<Alert variant="danger"> - <Alert.Heading>Commissioning Failure</Alert.Heading> - <p>Updated Template Failed to Upload</p> - <p>Status code: { await response.status }: { response.statusText }</p> - <p>Response Text: { await response.text() }</p> - <hr/> - </Alert>); - } - }, - - updateTemplate: async (userAddedCommonPropValues, fullToscaTemplate) => { - const nodeTemplates = fullToscaTemplate.topology_template.node_templates - const commonPropertyDataEntries = Object.entries(userAddedCommonPropValues) - - // This replaces the values for properties in the full tosca template - // that will be sent up to the api with the entries the user provided. - commonPropertyDataEntries.forEach(([templateKey, values]) => { - Object.entries(values).forEach(([propKey, propVal]) => { - nodeTemplates[templateKey].properties[propKey] = propVal - }) - }) - - fullToscaTemplate.topology_template.node_templates = nodeTemplates - - alert('Changes saved. Commission When Ready...') - return fullToscaTemplate - } -} - -export default CommissioningUtils; diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/utils/CommissioningUtils.test.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/utils/CommissioningUtils.test.js deleted file mode 100644 index 8304ecb..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/utils/CommissioningUtils.test.js +++ /dev/null @@ -1,94 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -import commonProps from "../testFiles/commonProps.json"; -import fullTemp from "../testFiles/fullTemplate.json"; -import CommissioningUtils from "./CommissioningUtils"; -import React from "react"; - -const commonProperties = JSON.parse(JSON.stringify(commonProps)) -const fullTemplate = JSON.parse(JSON.stringify(fullTemp)) - -describe('Verify CommissioningUtils', () => { - - const fullTemplatePromise = { - ok: true, - status: 200, - text: () => "OK", - json: () => { - return Promise.resolve(fullTemplate) - } - } - - const commonPropertiesPromise = { - ok: true, - status: 200, - text: () => "OK", - json: () => { - return Promise.resolve(commonProperties) - } - } - - it('test renderJsonEditor output is correct', async () => { - // Have to mock "editor" dom element for json editor to work in testing - document.body.innerHTML = '<div id="editor"></div>'; - - await expect((await CommissioningUtils.renderJsonEditor(fullTemplatePromise, commonPropertiesPromise)).editorTemp).toBeTruthy() - await expect((await CommissioningUtils.renderJsonEditor(fullTemplatePromise, commonPropertiesPromise)).fullTemplate).toBeTruthy() - await expect((await CommissioningUtils.renderJsonEditor(fullTemplatePromise, commonPropertiesPromise)).propertySchema).toBeTruthy() - await expect((await CommissioningUtils.renderJsonEditor(fullTemplatePromise, commonPropertiesPromise)).toscaInitialValues).toBeTruthy() - }) - - it('test the getType method object type', () => { - expect(CommissioningUtils.getType("object")).toBe("object") - }) - - it('test getAlertMessages with response ok', async () => { - const response = { - ok: true, - status: 200, - text: () => { - return Promise.resolve("OK") - }, - json: () => { - return Promise.resolve("{}") - } - } - - await expect(JSON.stringify(await CommissioningUtils.getAlertMessages(response))).toContain("Commissioning Success") - }) - - it('test getAlertMessages with response not ok', async () => { - const response = { - ok: false, - status: 200, - text: () => { - return Promise.resolve("Error") - }, - json: () => { - return Promise.resolve("{}") - } - } - - await expect(JSON.stringify(await CommissioningUtils.getAlertMessages(response))).toContain("Commissioning Failure") - }) - - - } -) diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/utils/InstantiationUtils.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/utils/InstantiationUtils.js deleted file mode 100644 index fd83432..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/utils/InstantiationUtils.js +++ /dev/null @@ -1,175 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - * - * - */ - -import { JSONEditor } from "@json-editor/json-editor"; - -const InstantiationUtils = { - - parseInstantiationList: (controlLoopList) => { - const parsedControlLoopList = []; - - controlLoopList.map((instance, index) => { - - const controlLoopObj = { - index, - name: instance['name'], - version: instance['version'], - orderedState: instance['orderedState'], - currentState: instance['state'], - disableDelete: instance['state'] !== 'UNINITIALISED' - } - - parsedControlLoopList.push(controlLoopObj); - }); - - return parsedControlLoopList; - }, - - makeSchemaForInstanceProperties: (instanceProps) => { - const instancePropsArray = Object.entries(instanceProps); - - const newSchemaObject = {}; - - newSchemaObject.title = "InstanceProperties"; - newSchemaObject.type = "object"; - newSchemaObject.properties = {}; - - instancePropsArray.forEach(([key, value]) => { - - const propertiesObject = {}; - - Object.entries(value.properties).forEach(([pKey, pValue]) => { - propertiesObject[pKey] = { - type: InstantiationUtils.getType(pValue.type) - } - }); - - newSchemaObject.properties[key] = { - options: { - "collapsed": true - }, - properties: propertiesObject - } - }); - - return newSchemaObject; - }, - - parseJsonSchema: async (template, instanceProperties) => { - const fullTemplate = await template.json(); - - const filteredInitialValues = {}; - - const allInstanceProperties = await instanceProperties.json().then(properties => { - const filteredTemplateObj = {}; - const propertiesTemplateArray = Object.entries(properties); - - propertiesTemplateArray.forEach(([key, value]) => { - const propertiesObj = { - properties: value.properties - } - - const propValues = {}; - filteredTemplateObj[key] = propertiesObj; - - const jsonNodeSchemaKey = fullTemplate.topology_template.node_templates[key] - - Object.entries(propertiesObj.properties).forEach(([pKey, pValue]) => { - propValues[pKey] = jsonNodeSchemaKey.properties[pKey]; - }); - - filteredInitialValues[key] = propValues; - }); - - return filteredTemplateObj; - }); - - const propertySchema = InstantiationUtils.makeSchemaForInstanceProperties(allInstanceProperties); - - const jsonEditor = InstantiationUtils.createJsonEditor(propertySchema, filteredInitialValues); - - return { - fullTemplate: fullTemplate, - jsonEditor: jsonEditor - } - }, - - getType: (pType) => { - switch (pType) { - case "map": - return "string"; - case "string": - return "string"; - case "integer": - return "integer"; - case "list": - return "array"; - case "object": - return "object"; - default: - return "object"; - } - }, - - createJsonEditor: (fullSchema, instanceProperties) => { - JSONEditor.defaults.options.collapse = true; - - return new JSONEditor(document.getElementById("editor"), - { - schema: fullSchema, - startval: instanceProperties, - theme: 'bootstrap4', - iconlib: 'fontawesome5', - object_layout: 'normal', - disable_properties: false, - disable_edit_json: false, - disable_array_reorder: true, - disable_array_delete_last_row: true, - disable_array_delete_all_rows: false, - array_controls_top: true, - keep_oneof_values: false, - collapsed: true, - show_errors: 'always', - display_required_only: false, - show_opt_in: false, - prompt_before_delete: true, - required_by_default: false, - }); - }, - - updateTemplate: (jsonEditorValues, fullTemplate) => { - const nodeTemplates = fullTemplate.topology_template.node_templates; - const instanceDataProperties = Object.entries(jsonEditorValues); - - instanceDataProperties.forEach(([key, value]) => { - const nodeTemplatesKey = nodeTemplates[key] - Object.entries(value).forEach(([pKey, pValue]) => { - nodeTemplatesKey.properties[pKey] = pValue - }); - }); - - fullTemplate.topology_template.node_templates = nodeTemplates; - - return fullTemplate; - } -} - -export default InstantiationUtils;
\ No newline at end of file diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/utils/InstantiationUtils.test.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/utils/InstantiationUtils.test.js deleted file mode 100644 index 4077ff8..0000000 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/utils/InstantiationUtils.test.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2022 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -import InstantiationUtils from "./InstantiationUtils"; -import instanceProps from "../testFiles/instanceProps.json"; -import fullTemp from "../testFiles/fullTemplate.json"; - -const instanceProperties = JSON.parse(JSON.stringify(instanceProps)) -const fullTemplate = JSON.parse(JSON.stringify(fullTemp)) - -describe('Verify InstantiationUtils', () => { - - const fullTemplatePromise = { - ok: true, - status: 200, - text: () => "OK", - json: () => { - return Promise.resolve(fullTemplate) - } - } - - const instancePropertiesPromise = { - ok: true, - status: 200, - text: () => "OK", - json: () => { - return Promise.resolve(instanceProperties) - } - } - - it('test parseJsonSchema output is correct', async () => { - // Have to mock "editor" dom element for json editor to work in testing - document.body.innerHTML = '<div id="editor"></div>'; - - await expect((await InstantiationUtils.parseJsonSchema(fullTemplatePromise, instancePropertiesPromise)).jsonEditor).toBeTruthy() - await expect((await InstantiationUtils.parseJsonSchema(fullTemplatePromise, instancePropertiesPromise)).fullTemplate).toBeTruthy() - }) -});
\ No newline at end of file |