aboutsummaryrefslogtreecommitdiffstats
path: root/src/k8splugin/api/api.go
AgeCommit message (Collapse)AuthorFilesLines
2022-03-02Implementation of status notification mechanism0.10.0Lukasz Rajewski1-2/+15
- Subscription CRUD endpoints - Subscription notifu executor - Cleanup of subscriptions on instance delete - Sending notification to the specified callback Issue-ID: MULTICLOUD-1445 Signed-off-by: Lukasz Rajewski <lukasz.rajewski@orange.com> Change-Id: I5b867a348e916f6c2c471bcc5326c831d832f45e
2022-02-25Upgrade handler implementationLukasz Rajewski1-0/+1
Implementation of the upgrade handler for the instance. As a result, exsting instance is modified, resources upated and lefovers removed from the cluster. Issue-ID: MULTICLOUD-1444 Signed-off-by: Lukasz Rajewski <lukasz.rajewski@orange.com> Change-Id: I4122ee12d9332eaeb5ee016446b3da2bbe94bd2d
2022-02-23ConfigAPI and Query API improvementsLukasz Rajewski1-0/+4
- Config Template create from the definition content - Missing CRUD Config handlers added - Improved Rollback and Config delete - Query API name filtering improved Issue-ID: MULTICLOUD-1437 Signed-off-by: Lukasz Rajewski <lukasz.rajewski@orange.com> Change-Id: Iec8ec6d03746085f294d9318a252f1ae45d3b9c8
2021-10-15Expose Update HandlersLukasz Rajewski1-0/+3
Expose Update Handlers for Definition, Profile and Config Tmpl Issue-ID: MULTICLOUD-1410 Signed-off-by: Lukasz Rajewski <lukasz.rajewski@orange.com> Change-Id: Ibe6fe05458f2af28f3e1ca14a54492a4bae19362
2021-10-04Further fixes for config delete operationLukasz Rajewski1-1/+2
The issue was related with insufficient handlijg of different versions of config vs their delete operation handled by the plugin. Issue-ID: MULTICLOUD-1332 Signed-off-by: Lukasz Rajewski <lukasz.rajewski@orange.com> Change-Id: I90d896720fa89ebd66cb3290cdd9401272f5e3fd
2021-09-28Fix for config resources delete with instance deleteLukasz Rajewski1-2/+3
Issue-ID: MULTICLOUD-1332 Signed-off-by: Lukasz Rajewski <lukasz.rajewski@orange.com> Change-Id: I08a3d623d6f12777d88a168af0cb804c63104887
2021-08-11Support pre/post install/delete hooks  hthieu1-0/+1
Update instance create and delete handler to support pre/post install/delete hooks.  Add hook.go: to execute and delete hook (base on delete policy).  Implement watchUntilReady in generic plugin to wait for readiness of hook rss. Add hook_sorter.go: to sort hook based on weight. User can define timeout for each type of hooks in overwrite-values. Variable name is k8s-rb-instance-pre-install-timeout (default 60s), k8s-rb-instance-post-install-timeout (default 600s), k8s-rb-instance-pre-delete-timeout (default 60s) and k8s-rb-instance-post-delete-timeout (600s). This is timeout for each hook of a hook event (not a total time). Add recovery capability to continue the execution of instantiation (create or delete) when the plugin stop unexpectedly. For now, this is disabled because we have data-race issue during test. Will enable when we find the solution. Add basic test for hooks (in hook_test.go) Add test for hook in instance_test For instance get request, we can request for full data by adding query param to the request: full=true. Issue-ID: MULTICLOUD-1347 Signed-off-by: hthieu <huu_trung.thieu@nokia-bell-labs.com> Change-Id: If2b4a90831b9bfce1af8b926e4062a7d706bee08
2021-08-02Merge "Add suport for query api on root level"Lukasz Rajewski1-2/+18
2021-08-02Add suport for query api on root levelLukasz Rajewski1-2/+18
Add suport for query api on root level. Instance query handler and root query handler merged. Issue-ID: MULTICLOUD-1379 Signed-off-by: Lukasz Rajewski <lukasz.rajewski@orange.com> Change-Id: I1dc95c7aca0e734edf5794e7c36143dc12070f2b
2021-08-02Config List handler added to Config APILukasz Rajewski1-0/+1
Config List handler added to Config API Issue-ID: MULTICLOUD-1332 Signed-off-by: Lukasz Rajewski <lukasz.rajewski@orange.com> Change-Id: I63355dd6b05e70398cfc89744efa332926286c40
2021-03-09Correct Query API endpoint registrationKonrad Bańka1-1/+1
Apart from corrections, corrected handling of name-only query requests as well as provided bunch of UTs. Issue-ID: MULTICLOUD-1307 Signed-off-by: Konrad Bańka <k.banka@samsung.com> Change-Id: Ida3d3e434525f323bd8c40ddc7ffd58df9c5e831
2021-02-25Provide Healthcheck API MVP0.8.0Konrad Bańka1-1/+13
Implements basic functionality of running starting Healthcheck. Results can be inspected so-far without dedicated API, by using, for example, Query API. Issue-ID: MULTICLOUD-1233 Signed-off-by: Konrad Bańka <k.banka@samsung.com> Change-Id: Ia4d96d936d573173d7d8f41e6c39d059bf5f8b1f
2021-02-25Merge "Provide Query API for CNF Instances"Ritu Sood1-0/+5
2021-02-24Provide Query API for CNF InstancesKonrad Bańka1-0/+6
Query API doesn't directly use Status API code, in order to allow for querying derived resources that might not be typically returned by Status API like replicasets for deployment. Issue-ID: MULTICLOUD-1305 Signed-off-by: Konrad Bańka <k.banka@samsung.com> Change-Id: If15adce23845880f3e6771cc8eab78a78ab13517
2021-02-23Move Day2 Config Values API to new endpointKonrad Bańka1-6/+7
Issue-ID: MULTICLOUD-1280 Signed-off-by: Konrad Bańka <k.banka@samsung.com> Change-Id: Ibeb0920b4ce083f4294b83c887fc7c793a2c3df5
2020-05-06Revert "Update brokerhandler API to conform with /v1/ path pattern"0.6.0Konrad Banka1-5/+4
This reverts commit 4ae60c1b50750587ab9d3960617a47d7db57b311. Reason for revert: Unable to reproduce bug, reverting fix implementation Issue-ID: MULTICLOUD-1053 Change-Id: Icc12260f9c122c6e5ac038d07a0e6cd56201e3ba Signed-off-by: Konrad Bańka <k.banka@samsung.com>
2020-04-16Update brokerhandler API to conform with /v1/ path patternKonrad Bańka1-4/+5
Issue-ID: MULTICLOUD-1053 Signed-off-by: Konrad Bańka <k.banka@samsung.com> Change-Id: I8f567bed2783e7257784cd4ce4c9f76207634e7a
2019-10-15Add a status getter api endpointKiran Kamineni1-0/+1
Add a status endpoint to get status of instances. Status information will be added to the database asynchronously. Issue-ID: MULTICLOUD-675 Change-Id: Ia7d79a6f18f01bf24f2690caf74a48c2a082bd73 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-08-13Add query parameters support to instance APIKiran Kamineni1-0/+6
Add support for query parameters to find instances with rb-name, rb-version, profile-name as query parameters eg: curl IP:PORT/v1/instance?rb-name=test&rb-version=v1 Issue-ID: MULTICLOUD-662 Change-Id: If68c87885c8b8dd097cbb3860e8c7320310a6ef7 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-07-23Merge "Add a listallhandler to definitions api"Bin Yang1-0/+1
2019-07-23Merge "Add a list api for instances"Bin Yang1-0/+1
2019-07-18Add list api for profilesKiran Kamineni1-0/+1
Add a list api for profiles for a specific definition and version. GET /v1/rb/definition/name/version/profile will list all the profiles. Issue-ID: MULTICLOUD-730 Change-Id: If1b8e6910c276a0f7139ab13340721c6ec8a49e8 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-07-18Add a listallhandler to definitions apiKiran Kamineni1-0/+1
GET calls to the v1/rb/definition will return all definitions and their versions Issue-ID: MULTICLOUD-715 Change-Id: Ia0951ac83283830e475bf727e7d5ced7aab3add2 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-07-18Add a list api for instancesKiran Kamineni1-0/+1
curl -X GET /v1/instance returns all the instances created. It returns abbreviated instances for improved readability. For details on what resources were created for each instance, use the ID with GET. Issue-ID: MULTICLOUD-715 Change-Id: I05afe0fd2c254acbca4329289c81545f95c9fac5 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-06-26Move connectionhandler.go into api packageKiran Kamineni1-5/+8
Move connectionhandler.go into api package This brings it inline with the other API handlers Issue-ID: MULTICLOUD-666 Change-Id: Ia3b832159f537c6d8d8ecc93b56bc9b085649f7e Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-06-24Change the import paths for go get accessKiran Kamineni1-3/+3
This allows other projects to do a go get and use this repo. go get github.com/multicloud-k8s/src/k8splugin will do the job. import github.com/multicloud-k8s/src/k8splugin will import the root package Issue-ID: MULTICLOUD-666 Change-Id: I2f41c88c5a7fb3305b78cce8a83a0e102baa444c Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-05-23Update broker responses to match spec and SOKiran Kamineni1-0/+1
The broker responses need to match the spec and what SO expects as responses. CREATE_COMPLETE instead of CREATED in both POST and GET DELETE now returns a response body GET by name is now supported Name is an alias for vf_module_id which is expected to be provided as an attribute in sdnc_directives in the original POST request Issue-ID: MULTICLOUD-645 Change-Id: Ifeca755a07298d0a858cbe9e80f9ce654d6d21b8 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-05-16Merge "Move config to app and connect to instance"Bin Yang1-2/+2
2019-05-15Move config to app and connect to instanceKiran Kamineni1-2/+2
Move config instantiation to app and connect it to the instance to allow updates and so on. Issue-ID: MULTICLOUD-464 Change-Id: Ic994ef78a6e0d2db5e695e33b7b8a302c74c10da Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-05-15Remove extra v1 from broker pathKiran Kamineni1-5/+4
Remove extra v1 from path as it is added in the MSB api anyway. Issue-ID: MULTICLOUD-630 Change-Id: Ib7adbf2315e0a3b1fe8170096d877df8f1b64683 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-04-25Adding healthcheck for OOM testingKiran Kamineni1-0/+3
Add a heathcheck endpoint for OOM testing Issue-ID: ONAPARC-363 Change-Id: Id5f77478d331fedb19ac162389d95852e10c5022 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-04-12Merge "Add Connectivity Info API"Bin Yang1-0/+9
2019-04-12Merge "Day 2 Configuration API's"Bin Yang1-1/+25
2019-04-11Add Connectivity Info APIrsood1-0/+9
API to add connectivity information for Cloud Regions to K8s Plugin https://wiki.onap.org/display/DW/MultiCloud+K8s-Plugin-service+API%27s Change-Id: I0a9166df9b076a7fdacf0b2f9e51a9cdebe4b621 Signed-off-by: rsood <ritu.sood@intel.com> Issue-ID: MULTICLOUD-292 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-04-11Add support for so integrationKiran Kamineni1-0/+7
Add support for the multicloud-api that is called by SO for instantiation. Issue-ID: MULTICLOUD-350 Change-Id: Icf9137dae9796ac256c3319b49af6c30b275a4a9 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-04-11Day 2 Configuration API'srsood1-1/+25
This patch adds Configuration API's https://wiki.onap.org/display/DW/MultiCloud+K8s-Plugin-service+API%27s Change-Id: I52ebfc5aa980ec8af4a31569d569216e9a2a760c Issue-ID: MULTICLOUD-464 Signed-off-by: rsood <ritu.sood@intel.com>
2019-04-03Refactor instance codeKiran Kamineni1-11/+17
Issue-ID: MULTICLOUD-350 Change-Id: I2574d94e4ebada1e138913b2a03549dd90906d7b Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-03-26Update definition and profile to latest specKiran Kamineni1-12/+10
Bringing all the definition and profile code upto the latest spec. Integrated the end to end instance code changes that were made. P9: Added updated plugin.sh with updated uri paths based on spec Issue-ID: MULTICLOUD-291 Change-Id: Id6e3c6bc2cd02cfb7005e203ccf03e0793b97e95 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-03-20NewRouter supports custom backend clientsKiran Kamineni1-14/+21
NewRouter needs to support custom clients This is needed where the backend clients are mocked and we need url path parameters to be available in our unit tests. Using the same router code allows us to do this. Issue-ID: MULTICLOUD-547 Change-Id: Id51b6f0a9afe4965efaf2611fc642bccb9ac1d39 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-01-25Move api.go functionsVictor Morales1-77/+0
CheckEnvVariables, CheckDatabaseConnection, LoadPlugins and CheckInitialSettings functions are utility functions which are not related with the API. These functions need to be moved to utils.go file. Change-Id: Ie6dfbafe8909962fba31534916a7e0f07ded116b Signed-off-by: Victor Morales <victor.morales@intel.com> Issue-ID: MULTICLOUD-301
2019-01-25Use a standard Go project layoutVictor Morales1-3/+3
This project wasn't following some Standard Go Project Layout guidelines(https://github.com/golang-standards/project-layout). This change pretends to organize the source code and following those guidelines. Change-Id: I61085ac20f28069cede013f83034bed06892d87c Signed-off-by: Victor Morales <victor.morales@intel.com> Issue-ID: MULTICLOUD-301
2019-01-17Add resource bundle profile apiKiran Kamineni1-0/+10
Add CRUD api for uploading profiles for specific definition resource bundles. - Adding unit tests Issue-ID: ONAPARC-348 Change-Id: Ic43724b4e2c035e7989c827612f1b2800fc49a69 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2018-12-19Merge "Add Network and OVN4NFV Plugins"Victor Morales1-2/+2
2018-12-05Add Network and OVN4NFV PluginsRitu Sood1-2/+2
This patch includes support for Network Objects through a new plugin. It also add the first sub-module plugin for OVN4NFVK8s support. Change-Id: Ia23c42d50f75a5206e1b6a04052c34e940518428 Signed-off-by: Ritu Sood <ritu.sood@intel.com> Signed-off-by: Victor Morales <victor.morales@intel.com> Issue-ID: MULTICLOUD-303
2018-11-21Add upload backend implementationKiran Kamineni1-1/+1
Upload is a seperate API where it takes a binary stream and stores it. The api supports tar.gz file format only. P2: Check if ID is valid before trying upload Add test with an invalid ID Issue-ID: MULTICLOUD-393 Change-Id: Id636a95823a046e1795d3be72d0214e953a8c5fc Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2018-11-19Reconcile names in code and Jira itemsKiran Kamineni1-8/+8
k8splugin manages deployment of resource bundles and these are not restricted to vnfs. This names' change is to reflect that functionality. P2: using rb instead of resource bundle Issue-ID: MULTICLOUD-410 Change-Id: I09e0b92a8fc13562e1c6bb17dc8bc13de97264d7 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2018-11-13Create UTs to cover DB callsVictor Morales1-6/+1
This change pretends to increase the code coverage creating Unit Tests for the interactions with the Databases. Change-Id: I3b78ebe8ddb131e3c06bcee0065ad5eabeed5677 Signed-off-by: Victor Morales <victor.morales@intel.com> Issue-ID: MULTICLOUD-301
2018-11-08Add vnf definition APIs3.0.0-ONAPcasablancaKiran Kamineni1-0/+9
Adding APIs for POST, GET, LIST (implemented via GET) and DELETE commands on /v1/vnfd base for creating, getting, listing and deleting VNF Definitions. P2: Added unit tests for vnfdhandler.go P3: Add unit tests for serialize and deserialize P4: Integrating review comments P5: Added customizable mocking for vnfdhandler_test P6: Added customizablt mocking for vnfd_test Note that this will soon need to be updated once the db changes go through in patch 71090 Issue-ID: MULTICLOUD-393 Change-Id: Id509bed370ab3bdc572c6ead22324c1ee3dbf82d Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com> Signed-off-by: Victor Morales <victor.morales@intel.com>
2018-08-31Make PLUGINS_DIR to be required than optionalShashank Kumar Shankar1-5/+2
This patch makes sure PLUGINS_DIR is not optional since its better explicitly pass the plugins directory. Change-Id: I08da5cf1563527d8b713fa106aa05b37a26c95cb Issue-ID: MULTICLOUD-301 Signed-off-by: Shashank Kumar Shankar <shashank.kumar.shankar@intel.com>
2018-08-24Seed code for k8s multicloud pluginShashank Kumar Shankar1-0/+120
This patch provides the initial seed code for the multicloud Kubernetes plugin and also provides the plugin feature to add new Kubernetes kinds. Change-Id: Ie5ee414656665070cde2834c4855ac2ebc179a9a Issue-ID: MULTICLOUD-301 Signed-off-by: Shashank Kumar Shankar <shashank.kumar.shankar@intel.com> Signed-off-by: Victor Morales <victor.morales@intel.com>